Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] base_wamas_ubl PromiseDeliveryPeriod #1034

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base_wamas_ubl/lib/wamas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ def generate_wamas_dict(dict_item, grammar, **kwargs): # noqa: C901
if isinstance(ubl_path, list):
lst_val = []
for _item in ubl_path:
lst_val.append(dict_item.get(_item, ""))
lst_val.append(dict_item.get(_item) or "")
if lst_val:
val = " ".join(lst_val)
val = " ".join(lst_val).strip()
elif isinstance(ubl_path, dict):
for _key in ubl_path:
if dict_item.get(_key, False):
Expand Down
4 changes: 2 additions & 2 deletions base_wamas_ubl/lib/wamas/wamas_grammar/weak.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@
"dp": False,
"ubl_path": [
"DespatchAdvice.cac:Shipment.cac:Delivery."
"cac:EstimatedDeliveryPeriod.cbc:EndDate",
"cac:PromiseDeliveryPeriod.cbc:EndDate",
"DespatchAdvice.cac:Shipment.cac:Delivery."
"cac:EstimatedDeliveryPeriod.cbc:EndTime",
"cac:PromiseDeliveryPeriod.cbc:EndTime",
],
"df_val": False,
"df_func": False,
Expand Down
8 changes: 6 additions & 2 deletions base_wamas_ubl/lib/wamas/wamas_grammar/weap.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@
"type": "datetime",
"length": 14,
"dp": False,
"ubl_path": "DespatchAdvice.cac:Shipment.cac:Delivery."
"cac:EstimatedDeliveryPeriod.cbc:EndDate",
"ubl_path": [
"DespatchAdvice.cac:Shipment.cac:Delivery."
"cac:EstimatedDeliveryPeriod.cbc:EndDate",
"DespatchAdvice.cac:Shipment.cac:Delivery."
"cac:EstimatedDeliveryPeriod.cbc:EndTime",
],
"df_val": False,
"df_func": False,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<cac:Shipment>
<cbc:ID>130377</cbc:ID>
<cac:Delivery>
<cac:PromiseDeliveryPeriod>
<cbc:EndDate>2023-05-02</cbc:EndDate>
<cbc:EndTime>15:00:00</cbc:EndTime>
</cac:PromiseDeliveryPeriod>
<cac:EstimatedDeliveryPeriod>
<cbc:EndDate>2023-05-01</cbc:EndDate>
<cbc:EndTime>14:00:00</cbc:EndTime>
Expand Down
12 changes: 6 additions & 6 deletions base_wamas_ubl/tests/samples/UBL2WAMAS-SAMPLE_WEAK_WEAP.wamas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ODOO WAMAS 00000120230501020000WEAK00050000WH/IN/000377 ODOO PO001040 STDMAN0001040 MyCompany Department StreetName AdditionalStreetName 95380 Turlock US (623)-853-7197 [email protected] 20230501160000
ODOO WAMAS 00000220230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000010001151 00000 NDISPONIBLE 000001536000BOUT NORMAL 20230501020000 202305010200007910063 NNLG
ODOO WAMAS 00000320230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000020001156 00000 NDISPONIBLE 000005184000PET NORMAL 20230501020000 202305010200007910105 NNLG
ODOO WAMAS 00000420230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000030001160 00000 NDISPONIBLE 000003840000BOUT NORMAL 20230501020000 202305010200007910004 NNLG
ODOO WAMAS 00000520230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000040001162 00000 NDISPONIBLE 000003072000PET NORMAL 20230501020000 2023050102000012156876 NNLG
ODOO WAMAS 00000620230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000050001176 00000 NDISPONIBLE 000003024000XBO NORMAL 20230501020000 202305010200007910044 NNLG
ODOO WAMAS 00000120230501020000WEAK00050000WH/IN/000377 ODOO PO001040 STDMAN0001040 MyCompany Department StreetName AdditionalStreetName 95380 Turlock US (623)-853-7197 [email protected] 20230502170000
ODOO WAMAS 00000220230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000010001151 00000 NDISPONIBLE 000001536000BOUT NORMAL 20230501020000 202305011600007910063 NNLG
ODOO WAMAS 00000320230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000020001156 00000 NDISPONIBLE 000005184000PET NORMAL 20230501020000 202305011600007910105 NNLG
ODOO WAMAS 00000420230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000030001160 00000 NDISPONIBLE 000003840000BOUT NORMAL 20230501020000 202305011600007910004 NNLG
ODOO WAMAS 00000520230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000040001162 00000 NDISPONIBLE 000003072000PET NORMAL 20230501020000 2023050116000012156876 NNLG
ODOO WAMAS 00000620230501020000WEAP00045000WH/IN/000377 ODOO PO001040 0000050001176 00000 NDISPONIBLE 000003024000XBO NORMAL 20230501020000 202305011600007910044 NNLG
Loading