Skip to content

Commit e0ab8c2

Browse files
committed
[IMP] l10n_my_edi: Assert entire XML in tests
At the moment, the tests in `l10n_my_edi` don't assert the entire XML contents. To ensure we don't break anything in future refactors, we change this so that the entire XML is asserted. task-none Part-of: odoo#213402 Related: odoo/enterprise#87222 Signed-off-by: Laurent Smet (las) <[email protected]>
1 parent 9191fd7 commit e0ab8c2

File tree

10 files changed

+1637
-25
lines changed

10 files changed

+1637
-25
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
3+
<cbc:ID>BILL/2019/01/0001</cbc:ID>
4+
<cbc:IssueDate>2019-01-01</cbc:IssueDate>
5+
<cbc:IssueTime>10:00:00Z</cbc:IssueTime>
6+
<cbc:InvoiceTypeCode listVersionID="1.1">11</cbc:InvoiceTypeCode>
7+
<cbc:DocumentCurrencyCode>MYR</cbc:DocumentCurrencyCode>
8+
<cbc:BuyerReference>MY-REF</cbc:BuyerReference>
9+
<cac:AdditionalDocumentReference>
10+
<cbc:ID>E12345678912</cbc:ID>
11+
<cbc:DocumentType>CustomsImportForm</cbc:DocumentType>
12+
</cac:AdditionalDocumentReference>
13+
<cac:AccountingSupplierParty>
14+
<cac:Party>
15+
<cac:PartyIdentification>
16+
<cbc:ID schemeID="TIN">C2584563201</cbc:ID>
17+
</cac:PartyIdentification>
18+
<cac:PartyIdentification>
19+
<cbc:ID schemeID="BRN">202001234568</cbc:ID>
20+
</cac:PartyIdentification>
21+
<cac:PartyName>
22+
<cbc:Name>partner_a</cbc:Name>
23+
</cac:PartyName>
24+
<cac:PostalAddress>
25+
<cbc:CityName>Main city</cbc:CityName>
26+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
27+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
28+
<cac:AddressLine>
29+
<cbc:Line>that other street, 3</cbc:Line>
30+
</cac:AddressLine>
31+
<cac:Country>
32+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
33+
<cbc:Name>Malaysia</cbc:Name>
34+
</cac:Country>
35+
</cac:PostalAddress>
36+
<cac:PartyLegalEntity>
37+
<cbc:RegistrationName>partner_a</cbc:RegistrationName>
38+
</cac:PartyLegalEntity>
39+
<cac:Contact>
40+
<cbc:ID>___ignore___</cbc:ID>
41+
<cbc:Name>partner_a</cbc:Name>
42+
<cbc:Telephone>+60123456786</cbc:Telephone>
43+
</cac:Contact>
44+
</cac:Party>
45+
</cac:AccountingSupplierParty>
46+
<cac:AccountingCustomerParty>
47+
<cac:Party>
48+
<cac:PartyIdentification>
49+
<cbc:ID schemeID="TIN">C2584563200</cbc:ID>
50+
</cac:PartyIdentification>
51+
<cac:PartyIdentification>
52+
<cbc:ID schemeID="BRN">202001234567</cbc:ID>
53+
</cac:PartyIdentification>
54+
<cac:PartyName>
55+
<cbc:Name>company_1_data</cbc:Name>
56+
</cac:PartyName>
57+
<cac:PostalAddress>
58+
<cbc:CityName>Main city</cbc:CityName>
59+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
60+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
61+
<cac:AddressLine>
62+
<cbc:Line>that one street, 5</cbc:Line>
63+
</cac:AddressLine>
64+
<cac:Country>
65+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
66+
<cbc:Name>Malaysia</cbc:Name>
67+
</cac:Country>
68+
</cac:PostalAddress>
69+
<cac:PartyLegalEntity>
70+
<cbc:RegistrationName>company_1_data</cbc:RegistrationName>
71+
</cac:PartyLegalEntity>
72+
<cac:Contact>
73+
<cbc:ID>___ignore___</cbc:ID>
74+
<cbc:Name>company_1_data</cbc:Name>
75+
<cbc:Telephone>+60123456789</cbc:Telephone>
76+
</cac:Contact>
77+
</cac:Party>
78+
</cac:AccountingCustomerParty>
79+
<cac:Delivery>
80+
<cac:DeliveryParty>
81+
<cac:PartyIdentification>
82+
<cbc:ID schemeID="TIN">C2584563200</cbc:ID>
83+
</cac:PartyIdentification>
84+
<cac:PartyIdentification>
85+
<cbc:ID schemeID="BRN">202001234567</cbc:ID>
86+
</cac:PartyIdentification>
87+
<cac:PostalAddress>
88+
<cbc:CityName>Main city</cbc:CityName>
89+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
90+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
91+
<cac:AddressLine>
92+
<cbc:Line>that one street, 5</cbc:Line>
93+
</cac:AddressLine>
94+
<cac:Country>
95+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
96+
<cbc:Name>Malaysia</cbc:Name>
97+
</cac:Country>
98+
</cac:PostalAddress>
99+
<cac:PartyLegalEntity>
100+
<cbc:RegistrationName>company_1_data</cbc:RegistrationName>
101+
</cac:PartyLegalEntity>
102+
</cac:DeliveryParty>
103+
</cac:Delivery>
104+
<cac:PaymentTerms>
105+
<cbc:Note>Payment terms: Immediate Payment</cbc:Note>
106+
</cac:PaymentTerms>
107+
<cac:TaxTotal>
108+
<cbc:TaxAmount currencyID="MYR">0.00</cbc:TaxAmount>
109+
<cac:TaxSubtotal>
110+
<cbc:TaxableAmount currencyID="MYR">800.00</cbc:TaxableAmount>
111+
<cbc:TaxAmount currencyID="MYR">0.00</cbc:TaxAmount>
112+
<cbc:Percent>0.0</cbc:Percent>
113+
<cac:TaxCategory>
114+
<cbc:ID>E</cbc:ID>
115+
<cbc:Name>Exempt Customer</cbc:Name>
116+
<cbc:Percent>0.0</cbc:Percent>
117+
<cbc:TaxExemptionReason>Exempt Customer</cbc:TaxExemptionReason>
118+
<cac:TaxScheme>
119+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
120+
</cac:TaxScheme>
121+
</cac:TaxCategory>
122+
</cac:TaxSubtotal>
123+
</cac:TaxTotal>
124+
<cac:LegalMonetaryTotal>
125+
<cbc:LineExtensionAmount currencyID="MYR">800.00</cbc:LineExtensionAmount>
126+
<cbc:TaxExclusiveAmount currencyID="MYR">800.00</cbc:TaxExclusiveAmount>
127+
<cbc:TaxInclusiveAmount currencyID="MYR">800.00</cbc:TaxInclusiveAmount>
128+
<cbc:PrepaidAmount currencyID="MYR">0.00</cbc:PrepaidAmount>
129+
<cbc:PayableAmount currencyID="MYR">800.00</cbc:PayableAmount>
130+
</cac:LegalMonetaryTotal>
131+
<cac:InvoiceLine>
132+
<cbc:ID>1</cbc:ID>
133+
<cbc:InvoicedQuantity unitCode="C62">1.0</cbc:InvoicedQuantity>
134+
<cbc:LineExtensionAmount currencyID="MYR">800.00</cbc:LineExtensionAmount>
135+
<cac:TaxTotal>
136+
<cbc:TaxAmount currencyID="MYR">0.00</cbc:TaxAmount>
137+
<cac:TaxSubtotal>
138+
<cbc:TaxableAmount currencyID="MYR">800.00</cbc:TaxableAmount>
139+
<cbc:TaxAmount currencyID="MYR">0.00</cbc:TaxAmount>
140+
<cbc:Percent>0.0</cbc:Percent>
141+
<cac:TaxCategory>
142+
<cbc:ID>E</cbc:ID>
143+
<cbc:Name>Exempt Customer</cbc:Name>
144+
<cbc:Percent>0.0</cbc:Percent>
145+
<cbc:TaxExemptionReason>Exempt Customer</cbc:TaxExemptionReason>
146+
<cac:TaxScheme>
147+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
148+
</cac:TaxScheme>
149+
</cac:TaxCategory>
150+
</cac:TaxSubtotal>
151+
</cac:TaxTotal>
152+
<cac:Item>
153+
<cbc:Description>product_a</cbc:Description>
154+
<cbc:Name>product_a</cbc:Name>
155+
<cac:CommodityClassification>
156+
<cbc:ItemClassificationCode listID="CLASS">001</cbc:ItemClassificationCode>
157+
</cac:CommodityClassification>
158+
<cac:ClassifiedTaxCategory>
159+
<cbc:ID>E</cbc:ID>
160+
<cbc:Name>Exempt Customer</cbc:Name>
161+
<cbc:Percent>0.0</cbc:Percent>
162+
<cbc:TaxExemptionReason>Exempt Customer</cbc:TaxExemptionReason>
163+
<cac:TaxScheme>
164+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
165+
</cac:TaxScheme>
166+
</cac:ClassifiedTaxCategory>
167+
</cac:Item>
168+
<cac:Price>
169+
<cbc:PriceAmount currencyID="MYR">800.0</cbc:PriceAmount>
170+
</cac:Price>
171+
<cac:ItemPriceExtension>
172+
<cbc:Amount currencyID="MYR">800.00</cbc:Amount>
173+
</cac:ItemPriceExtension>
174+
</cac:InvoiceLine>
175+
</Invoice>
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
3+
<cbc:ID>RINV/2024/00001</cbc:ID>
4+
<cbc:IssueDate>2024-07-15</cbc:IssueDate>
5+
<cbc:IssueTime>10:00:00Z</cbc:IssueTime>
6+
<cbc:InvoiceTypeCode listVersionID="1.1">02</cbc:InvoiceTypeCode>
7+
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
8+
<cbc:BuyerReference>MY-REF</cbc:BuyerReference>
9+
<cac:BillingReference>
10+
<cac:InvoiceDocumentReference>
11+
<cbc:ID>INV/2019/00001</cbc:ID>
12+
<cbc:UUID>12345678912345678912345678</cbc:UUID>
13+
</cac:InvoiceDocumentReference>
14+
</cac:BillingReference>
15+
<cac:AccountingSupplierParty>
16+
<cac:Party>
17+
<cbc:IndustryClassificationCode name="Growing of maize">01111</cbc:IndustryClassificationCode>
18+
<cac:PartyIdentification>
19+
<cbc:ID schemeID="TIN">C2584563200</cbc:ID>
20+
</cac:PartyIdentification>
21+
<cac:PartyIdentification>
22+
<cbc:ID schemeID="BRN">202001234567</cbc:ID>
23+
</cac:PartyIdentification>
24+
<cac:PartyName>
25+
<cbc:Name>company_1_data</cbc:Name>
26+
</cac:PartyName>
27+
<cac:PostalAddress>
28+
<cbc:CityName>Main city</cbc:CityName>
29+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
30+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
31+
<cac:AddressLine>
32+
<cbc:Line>that one street, 5</cbc:Line>
33+
</cac:AddressLine>
34+
<cac:Country>
35+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
36+
<cbc:Name>Malaysia</cbc:Name>
37+
</cac:Country>
38+
</cac:PostalAddress>
39+
<cac:PartyLegalEntity>
40+
<cbc:RegistrationName>company_1_data</cbc:RegistrationName>
41+
</cac:PartyLegalEntity>
42+
<cac:Contact>
43+
<cbc:ID>___ignore___</cbc:ID>
44+
<cbc:Name>company_1_data</cbc:Name>
45+
<cbc:Telephone>+60123456789</cbc:Telephone>
46+
</cac:Contact>
47+
</cac:Party>
48+
</cac:AccountingSupplierParty>
49+
<cac:AccountingCustomerParty>
50+
<cac:Party>
51+
<cac:PartyIdentification>
52+
<cbc:ID schemeID="TIN">C2584563201</cbc:ID>
53+
</cac:PartyIdentification>
54+
<cac:PartyIdentification>
55+
<cbc:ID schemeID="BRN">202001234568</cbc:ID>
56+
</cac:PartyIdentification>
57+
<cac:PartyName>
58+
<cbc:Name>partner_a</cbc:Name>
59+
</cac:PartyName>
60+
<cac:PostalAddress>
61+
<cbc:CityName>Main city</cbc:CityName>
62+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
63+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
64+
<cac:AddressLine>
65+
<cbc:Line>that other street, 3</cbc:Line>
66+
</cac:AddressLine>
67+
<cac:Country>
68+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
69+
<cbc:Name>Malaysia</cbc:Name>
70+
</cac:Country>
71+
</cac:PostalAddress>
72+
<cac:PartyLegalEntity>
73+
<cbc:RegistrationName>partner_a</cbc:RegistrationName>
74+
</cac:PartyLegalEntity>
75+
<cac:Contact>
76+
<cbc:ID>___ignore___</cbc:ID>
77+
<cbc:Name>partner_a</cbc:Name>
78+
<cbc:Telephone>+60123456786</cbc:Telephone>
79+
</cac:Contact>
80+
</cac:Party>
81+
</cac:AccountingCustomerParty>
82+
<cac:Delivery>
83+
<cac:DeliveryParty>
84+
<cac:PartyIdentification>
85+
<cbc:ID schemeID="TIN">C2584563201</cbc:ID>
86+
</cac:PartyIdentification>
87+
<cac:PartyIdentification>
88+
<cbc:ID schemeID="BRN">202001234568</cbc:ID>
89+
</cac:PartyIdentification>
90+
<cac:PostalAddress>
91+
<cbc:CityName>Main city</cbc:CityName>
92+
<cbc:CountrySubentity>Johor</cbc:CountrySubentity>
93+
<cbc:CountrySubentityCode>01</cbc:CountrySubentityCode>
94+
<cac:AddressLine>
95+
<cbc:Line>that other street, 3</cbc:Line>
96+
</cac:AddressLine>
97+
<cac:Country>
98+
<cbc:IdentificationCode listID="ISO3166-1" listAgencyID="6">MYS</cbc:IdentificationCode>
99+
<cbc:Name>Malaysia</cbc:Name>
100+
</cac:Country>
101+
</cac:PostalAddress>
102+
<cac:PartyLegalEntity>
103+
<cbc:RegistrationName>partner_a</cbc:RegistrationName>
104+
</cac:PartyLegalEntity>
105+
</cac:DeliveryParty>
106+
</cac:Delivery>
107+
<cac:TaxExchangeRate>
108+
<cbc:SourceCurrencyCode>EUR</cbc:SourceCurrencyCode>
109+
<cbc:TargetCurrencyCode>MYR</cbc:TargetCurrencyCode>
110+
<cbc:CalculationRate>0.5</cbc:CalculationRate>
111+
</cac:TaxExchangeRate>
112+
<cac:TaxTotal>
113+
<cbc:TaxAmount currencyID="EUR">200.00</cbc:TaxAmount>
114+
<cac:TaxSubtotal>
115+
<cbc:TaxableAmount currencyID="EUR">2000.00</cbc:TaxableAmount>
116+
<cbc:TaxAmount currencyID="EUR">200.00</cbc:TaxAmount>
117+
<cbc:Percent>10.0</cbc:Percent>
118+
<cac:TaxCategory>
119+
<cbc:ID>01</cbc:ID>
120+
<cbc:Percent>10.0</cbc:Percent>
121+
<cac:TaxScheme>
122+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
123+
</cac:TaxScheme>
124+
</cac:TaxCategory>
125+
</cac:TaxSubtotal>
126+
</cac:TaxTotal>
127+
<cac:LegalMonetaryTotal>
128+
<cbc:LineExtensionAmount currencyID="EUR">2000.00</cbc:LineExtensionAmount>
129+
<cbc:TaxExclusiveAmount currencyID="EUR">2000.00</cbc:TaxExclusiveAmount>
130+
<cbc:TaxInclusiveAmount currencyID="EUR">2200.00</cbc:TaxInclusiveAmount>
131+
<cbc:PrepaidAmount currencyID="EUR">2200.00</cbc:PrepaidAmount>
132+
<cbc:PayableAmount currencyID="EUR">0.00</cbc:PayableAmount>
133+
</cac:LegalMonetaryTotal>
134+
<cac:InvoiceLine>
135+
<cbc:ID>1</cbc:ID>
136+
<cbc:InvoicedQuantity unitCode="C62">1.0</cbc:InvoicedQuantity>
137+
<cbc:LineExtensionAmount currencyID="EUR">2000.00</cbc:LineExtensionAmount>
138+
<cac:TaxTotal>
139+
<cbc:TaxAmount currencyID="EUR">200.00</cbc:TaxAmount>
140+
<cac:TaxSubtotal>
141+
<cbc:TaxableAmount currencyID="EUR">2000.00</cbc:TaxableAmount>
142+
<cbc:TaxAmount currencyID="EUR">200.00</cbc:TaxAmount>
143+
<cbc:Percent>10.0</cbc:Percent>
144+
<cac:TaxCategory>
145+
<cbc:ID>01</cbc:ID>
146+
<cbc:Percent>10.0</cbc:Percent>
147+
<cac:TaxScheme>
148+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
149+
</cac:TaxScheme>
150+
</cac:TaxCategory>
151+
</cac:TaxSubtotal>
152+
</cac:TaxTotal>
153+
<cac:Item>
154+
<cbc:Description>product_a</cbc:Description>
155+
<cbc:Name>product_a</cbc:Name>
156+
<cac:CommodityClassification>
157+
<cbc:ItemClassificationCode listID="CLASS">001</cbc:ItemClassificationCode>
158+
</cac:CommodityClassification>
159+
<cac:ClassifiedTaxCategory>
160+
<cbc:ID>01</cbc:ID>
161+
<cbc:Percent>10.0</cbc:Percent>
162+
<cac:TaxScheme>
163+
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">OTH</cbc:ID>
164+
</cac:TaxScheme>
165+
</cac:ClassifiedTaxCategory>
166+
</cac:Item>
167+
<cac:Price>
168+
<cbc:PriceAmount currencyID="EUR">2000.0</cbc:PriceAmount>
169+
</cac:Price>
170+
<cac:ItemPriceExtension>
171+
<cbc:Amount currencyID="EUR">2000.00</cbc:Amount>
172+
</cac:ItemPriceExtension>
173+
</cac:InvoiceLine>
174+
</Invoice>

0 commit comments

Comments
 (0)