
from sysactions import get_model, get_posot
from xml.etree import cElementTree as eTree


def synchronize_ui(
    pos_id,         # type: str
    model=None,     # type: eTree.Element

):
    # type: (...) -> None

    if model is None:
        model = get_model(posid=pos_id)

    pos_ot = get_posot(model=model)

    sale_type = model.find(".//Order").get("saleType")
    pos_ot.updateOrderProperties(
        posid=pos_id,
        saletype=sale_type,
    )
