Skip to content

Commit

Permalink
[UPD] base_wamas_ubl: Update grammars ARTEAN, WEAK, WEAP
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantrantg committed Jan 31, 2024
1 parent 8c8984f commit 01de8a1
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 23 deletions.
11 changes: 8 additions & 3 deletions base_wamas_ubl/lib/wamas/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@

DICT_TUPLE_KEY_RECEPTION = {
("WEAKQ", "WEAPQ"): (
"ubl_template/reception_wea.xml",
"ubl_template/reception.xml",
("WEAKQ", "IvWevk_WevId_WevNr"),
("WEAPQ", "IvWevp_WevId_WevNr"),
),
("KRETKQ", "KRETPQ"): (
"ubl_template/reception_kret.xml",
"ubl_template/return.xml",
("KRETKQ", "IvKretk_KretId_KretNr"),
("KRETPQ", "IvKretp_KretId_KretNr"),
),
Expand All @@ -174,7 +174,12 @@
# CONVERT UNIT CODE
##

LST_FIELD_UNIT_CODE = ["HostEinheit"]
LST_FIELD_UNIT_CODE = [
"HostEinheit",
"Art_Anzeige_Einheit",
"Arte_Einheit",
"ArtEan_EST_Einheit",
]


MAPPING_UNITCODE_WAMAS_TO_UBL = {
Expand Down
2 changes: 1 addition & 1 deletion base_wamas_ubl/lib/wamas/wamas_grammar/artean.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"type": "str",
"length": 5,
"dp": False,
"dict_key": False,
"dict_key": "product_uom",
"df_val": False,
"df_func": 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 @@ -63,8 +63,8 @@
"length": 5,
"dp": False,
"ubl_path": False,
"df_val": "HOST",
"df_func": False,
"df_val": False,
"df_func": "get_source",
},
"RxWeak_ExtRef": {
"type": "str",
Expand Down
4 changes: 2 additions & 2 deletions base_wamas_ubl/lib/wamas/wamas_grammar/weap.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"length": 5,
"dp": False,
"ubl_path": False,
"df_val": "HOST",
"df_func": False,
"df_val": False,
"df_func": "get_source",
},
"RxWeap_ExtRef": {
"type": "str",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Error: Length of line does not match expected length
- Error: Length of line does not match expected length
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Error: Invalid telegram type: XYZ
- Error: Invalid telegram type: XYZ
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"barcode": "256256256",
"product": "113 113 113",
"product_uom": "C62",
"game_identifier": "N",
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ODOO WAMAS 00000120231221051251ARTEAN001000113 113 113 00000256256256 N
ODOO WAMAS 00000120231221051251ARTEAN001000113 113 113 00000256256256 BOUT N
12 changes: 6 additions & 6 deletions base_wamas_ubl/tests/samples/UBL2WAMAS-SAMPLE_KRETK_KRETP.wamas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ODOO WAMAS 00000120230501020000KRETK0051000130377 HOST STDMAN0001040 MyCompany 1839 Arbor Way California 95380 Turlock US (623)-853-7197 wood.corner26@example.com 20230427000000
ODOO WAMAS 00000220230501020000KRETP0046000130377 HOST 0000200001151 0000020001151 00000DISPONIBLE 000001536000BOUT N
ODOO WAMAS 00000320230501020000KRETP0046000130377 HOST 0000300001156 0000030001156 00000DISPONIBLE 000005184000PET N
ODOO WAMAS 00000420230501020000KRETP0046000130377 HOST 0000400001160 0000040001160 00000DISPONIBLE 000003840000BOUT N
ODOO WAMAS 00000520230501020000KRETP0046000130377 HOST 0000500001162 0000050001162 00000DISPONIBLE 000003072000PET N
ODOO WAMAS 00000620230501020000KRETP0046000130377 HOST 0000600001176 0000060001176 00000DISPONIBLE 000003024000PET N
ODOO WAMAS 00000120230501020000KRETK0051000130377 HOST STDMAN0001040 STDMAN0001040 MyCompany 1839 Arbor Way California 95380 Turlock US (623)-853-7197 wood.corner26@example.com 20230427020000
ODOO WAMAS 00000220230501020000KRETP0046000130377 HOST 0001 0000020001151 00000DISPONIBLE 000001536000BOUT N
ODOO WAMAS 00000320230501020000KRETP0046000130377 HOST 0002 0000030001156 00000DISPONIBLE 000005184000PET N
ODOO WAMAS 00000420230501020000KRETP0046000130377 HOST 0003 0000040001160 00000DISPONIBLE 000003840000BOUT N
ODOO WAMAS 00000520230501020000KRETP0046000130377 HOST 0004 0000050001162 00000DISPONIBLE 000003072000PET N
ODOO WAMAS 00000620230501020000KRETP0046000130377 HOST 0005 0000060001176 00000DISPONIBLE 000003024000PET N
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 00000120230501020000WEAK00050000130377 HOST STDMAN0001040 MyCompany 1839 Arbor Way California 95380 Turlock US (623)-853-7197 wood.corner26@example.com 20230427000000
ODOO WAMAS 00000220230501020000WEAP00045000130377 HOST 0000200001151 0000020001151 00000 NDISPONIBLE 000001536000BOUT NORMAL 20230501020000 202305010000007910063 NNLG
ODOO WAMAS 00000320230501020000WEAP00045000130377 HOST 0000300001156 0000030001156 00000 NDISPONIBLE 000005184000PET NORMAL 20230501020000 202305010000007910105 NNLG
ODOO WAMAS 00000420230501020000WEAP00045000130377 HOST 0000400001160 0000040001160 00000 NDISPONIBLE 000003840000BOUT NORMAL 20230501020000 202305010000007910004 NNLG
ODOO WAMAS 00000520230501020000WEAP00045000130377 HOST 0000500001162 0000050001162 00000 NDISPONIBLE 000003072000PET NORMAL 20230501020000 2023050100000012156876 NNLG
ODOO WAMAS 00000620230501020000WEAP00045000130377 HOST 0000600001176 0000060001176 00000 NDISPONIBLE 000003024000PET NORMAL 20230501020000 202305010000007910044 NNLG
ODOO WAMAS 00000120230501020000WEAK00050000130377 ODOO STDMAN0001040 STDMAN0001040 MyCompany 1839 Arbor Way California 95380 Turlock US (623)-853-7197 wood.corner26@example.com 20230427020000
ODOO WAMAS 00000220230501020000WEAP00045000130377 ODOO 0001 0000020001151 00000 NDISPONIBLE 000001536000BOUT NORMAL 20230501020000 202305010200007910063 NNLG
ODOO WAMAS 00000320230501020000WEAP00045000130377 ODOO 0002 0000030001156 00000 NDISPONIBLE 000005184000PET NORMAL 20230501020000 202305010200007910105 NNLG
ODOO WAMAS 00000420230501020000WEAP00045000130377 ODOO 0003 0000040001160 00000 NDISPONIBLE 000003840000BOUT NORMAL 20230501020000 202305010200007910004 NNLG
ODOO WAMAS 00000520230501020000WEAP00045000130377 ODOO 0004 0000050001162 00000 NDISPONIBLE 000003072000PET NORMAL 20230501020000 2023050102000012156876 NNLG
ODOO WAMAS 00000620230501020000WEAP00045000130377 ODOO 0005 0000060001176 00000 NDISPONIBLE 000003024000PET NORMAL 20230501020000 202305010200007910044 NNLG
1 change: 1 addition & 0 deletions base_wamas_ubl/tests/test_base_wamas_ubl.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _wamas_ubl_wiz_check(self, input_file, expected_output_file):
wizard.btn_check()
self.assertTrue(self._is_string_similar(wizard.output, str_expected_output))

@freeze_time("2023-12-20 09:11:16")
def _wamas_ubl_wiz_simulate(
self, input_file, expected_output_file, state="success"
):
Expand Down

0 comments on commit 01de8a1

Please sign in to comment.