Skip to content
Snippets Groups Projects
Commit b999489d authored by Julien Van Roy's avatar Julien Van Roy
Browse files

[FIX] account_edi_ubl_cii: allow importing any bis3 related format


After 863fa450, the UBLVersionId node
was removed from the Bis 3 and its inheriting formats.

Thus, the fonction infering the format from an xml etree needed to be
apdated too, since we can no longer rely on the `UBLVersionID` node for
UBL Bis 3 and its inheriting formats. The `CustomizationID` node is
used.

closes odoo/odoo#118043

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent ad01728c
No related branches found
No related tags found
No related merge requests found
......@@ -33,18 +33,19 @@ class AccountEdiFormat(models.Model):
customization_id = tree.find('{*}CustomizationID')
if tree.tag == '{urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100}CrossIndustryInvoice':
return self.env['account.edi.xml.cii']
if customization_id is not None:
if 'xrechnung' in customization_id.text:
return self.env['account.edi.xml.ubl_de']
if customization_id.text == 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0':
return self.env['account.edi.xml.ubl_bis3']
if customization_id.text == 'urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0':
return self.env['account.edi.xml.ubl_nl']
if ubl_version is not None:
if ubl_version.text == '2.0':
return self.env['account.edi.xml.ubl_20']
if ubl_version.text == '2.1':
return self.env['account.edi.xml.ubl_21']
if customization_id is not None:
if 'xrechnung' in customization_id.text:
return self.env['account.edi.xml.ubl_de']
if customization_id.text == 'urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0':
return self.env['account.edi.xml.ubl_nl']
# Allow to parse any format derived from the european semantic norm EN16931
if 'urn:cen.eu:en16931:2017' in customization_id.text:
return self.env['account.edi.xml.ubl_bis3']
return
def _get_xml_builder(self, company):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment