add Factur-X-EN16931
This commit is contained in:
parent
4e03a1022e
commit
037ff9636a
4 changed files with 455 additions and 8 deletions
13
document.py
13
document.py
|
@ -30,7 +30,7 @@ xml_types = [
|
|||
(['xsd', 'Factur-X_1.07.2_BASICWL', 'Factur-X_1.07.2_BASICWL.xsd'],
|
||||
'Factur-X basicwl', 'facturx_basicwl'),
|
||||
(['xsd', 'Factur-X_1.07.2_EN16931', 'Factur-X_1.07.2_EN16931.xsd'],
|
||||
'Factur-X EN16931', ''),
|
||||
'Factur-X EN16931', 'facturx_en16931'),
|
||||
(['xsd', 'Factur-X_1.07.2_EXTENDED', 'Factur-X_1.07.2_EXTENDED.xsd'],
|
||||
'Factur-X extended', 'facturx_extended'),
|
||||
(['xsd', 'CII D22B XSD', 'CrossIndustryInvoice_100pD22B.xsd'],
|
||||
|
@ -63,25 +63,20 @@ class Incoming(metaclass=PoolMeta):
|
|||
with_children (bool, optional): convert sub-documents.
|
||||
Defaults to False.
|
||||
"""
|
||||
print('\n## process:', documents)
|
||||
for document in documents:
|
||||
document._facturx_detect_content()
|
||||
print('-- process-2:')
|
||||
super().process(documents, with_children)
|
||||
print('-- process-3:')
|
||||
|
||||
def _process_supplier_invoice(self):
|
||||
""" try to detect content of 'data', read values
|
||||
"""
|
||||
invoice = super()._process_supplier_invoice()
|
||||
print('\n## _process_supplier_invoice:', self)
|
||||
|
||||
if self.mime_type == 'application/xml':
|
||||
# detect xml-content
|
||||
xml_info = self._facturx_detect_content()
|
||||
if xml_info:
|
||||
(xsd_type, funcname, xmltree) = xml_info
|
||||
print('-- _process_supplier_invoice-xml_info:', xml_info)
|
||||
xml_read_func = getattr(self, '_readxml_%s' % funcname, None)
|
||||
if not xml_read_func:
|
||||
raise UserError(gettext(
|
||||
|
@ -95,7 +90,6 @@ class Incoming(metaclass=PoolMeta):
|
|||
invoice.save()
|
||||
self._readxml_check_invoice(invoice)
|
||||
# raise ValueError('stop')
|
||||
print('-- _process_supplier_invoice-FIN:', invoice)
|
||||
return invoice
|
||||
|
||||
def _readxml_check_invoice(self, invoice):
|
||||
|
@ -436,6 +430,11 @@ class Incoming(metaclass=PoolMeta):
|
|||
'document_incoming_invoice_xml.msg_convert_error',
|
||||
msg='factur-x basic-wl not supported'))
|
||||
|
||||
def _readxml_facturx_en16931(self, xmltree):
|
||||
""" read facturx - EN16931
|
||||
"""
|
||||
self._readxml_facturx_extended(xmltree)
|
||||
|
||||
def _readxml_facturx_extended(self, xmltree):
|
||||
""" read factur-x extended
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue