trytond-edocument-ubl 7.8.8__tar.gz → 7.8.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/CHANGELOG +10 -0
  2. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/PKG-INFO +1 -1
  3. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/edocument.py +44 -27
  4. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/scenario_ubl_2_credit_note_parse.rst +1 -1
  5. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/scenario_ubl_2_invoice_parse.rst +1 -1
  6. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tryton.cfg +1 -1
  7. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/PKG-INFO +1 -1
  8. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/COPYRIGHT +0 -0
  9. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/LICENSE +0 -0
  10. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/MANIFEST.in +0 -0
  11. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/README.rst +0 -0
  12. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/__init__.py +0 -0
  13. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/account.py +0 -0
  14. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/account.xml +0 -0
  15. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/doc/conf.py +0 -0
  16. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/doc/design.rst +0 -0
  17. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/doc/index.rst +0 -0
  18. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/doc/releases.rst +0 -0
  19. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/doc/requirements-doc.txt +0 -0
  20. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/document.py +0 -0
  21. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/exceptions.py +0 -0
  22. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/icons/LICENSE +0 -0
  23. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/bg.po +0 -0
  24. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/ca.po +0 -0
  25. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/cs.po +0 -0
  26. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/de.po +0 -0
  27. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/es.po +0 -0
  28. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/es_419.po +0 -0
  29. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/et.po +0 -0
  30. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/fa.po +0 -0
  31. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/fi.po +0 -0
  32. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/fr.po +0 -0
  33. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/hu.po +0 -0
  34. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/id.po +0 -0
  35. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/it.po +0 -0
  36. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/lo.po +0 -0
  37. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/lt.po +0 -0
  38. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/nl.po +0 -0
  39. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/pl.po +0 -0
  40. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/pt.po +0 -0
  41. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/ro.po +0 -0
  42. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/ru.po +0 -0
  43. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/sl.po +0 -0
  44. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/tr.po +0 -0
  45. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/uk.po +0 -0
  46. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/locale/zh_CN.po +0 -0
  47. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/message.xml +0 -0
  48. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/party.py +0 -0
  49. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/setup.cfg +0 -0
  50. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/setup.py +0 -0
  51. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/template/2/CreditNote.xml +0 -0
  52. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/template/2/Invoice.xml +0 -0
  53. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/template/2/base.xml +0 -0
  54. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/BDNDR-CCTS_CCT_SchemaModule-1.1.xsd +0 -0
  55. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/BDNDR-UnqualifiedDataTypes-1.1.xsd +0 -0
  56. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-CommonAggregateComponents-2.4.xsd +0 -0
  57. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-CommonBasicComponents-2.4.xsd +0 -0
  58. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-CommonExtensionComponents-2.4.xsd +0 -0
  59. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-CommonSignatureComponents-2.4.xsd +0 -0
  60. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-ExtensionContentDataType-2.4.xsd +0 -0
  61. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-QualifiedDataTypes-2.4.xsd +0 -0
  62. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-SignatureAggregateComponents-2.4.xsd +0 -0
  63. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-SignatureBasicComponents-2.4.xsd +0 -0
  64. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-XAdES01903v132-201601-2.4.xsd +0 -0
  65. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-XAdES01903v141-201601-2.4.xsd +0 -0
  66. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-xmldsig-core-schema-2.4.xsd +0 -0
  67. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-xmldsig1-schema-2.4.xsd +0 -0
  68. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/common/UBL-xmldsig11-schema-2.4.xsd +0 -0
  69. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/maindoc/UBL-CreditNote-2.4.xsd +0 -0
  70. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/2.4/maindoc/UBL-Invoice-2.4.xsd +0 -0
  71. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/UBL-CreditNote-2.1-Example.xml +0 -0
  72. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/UBL-Invoice-2.1-Example-Trivial.xml +0 -0
  73. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/UBL-Invoice-2.1-Example.xml +0 -0
  74. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/__init__.py +0 -0
  75. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/scenario_ubl_2_credit_note_parse.json +0 -0
  76. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/scenario_ubl_2_invoice_parse.json +0 -0
  77. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/scenario_ubl_2_invoice_parse_trivial.rst +0 -0
  78. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/test_module.py +0 -0
  79. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tests/test_scenario.py +0 -0
  80. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/tox.ini +0 -0
  81. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/SOURCES.txt +0 -0
  82. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/dependency_links.txt +0 -0
  83. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/entry_points.txt +0 -0
  84. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/not-zip-safe +0 -0
  85. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/requires.txt +0 -0
  86. {trytond_edocument_ubl-7.8.8 → trytond_edocument_ubl-7.8.10}/trytond_edocument_ubl.egg-info/top_level.txt +0 -0
@@ -1,4 +1,14 @@
1
1
 
2
+ Version 7.8.10 - 2026-09-16
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.8.9 - 2026-08-15
8
+ --------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.8.8 - 2026-08-04
3
13
  --------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trytond_edocument_ubl
3
- Version: 7.8.8
3
+ Version: 7.8.10
4
4
  Summary: Tryton module for electronic document UBL
5
5
  Home-page: http://www.tryton.org/
6
6
  Download-URL: http://downloads.tryton.org/7.8/
@@ -272,11 +272,24 @@ class Invoice(Model):
272
272
  type_code=type_code))
273
273
 
274
274
  invoice = Invoice(type='in')
275
+
276
+ if (customer_party := root.find('./{*}AccountingCustomerParty')
277
+ ) is not None:
278
+ invoice.company = cls._parse_2_company(customer_party)
279
+ else:
280
+ invoice.company = Invoice.default_company()
281
+ if not invoice.company:
282
+ raise InvoiceError(gettext(
283
+ 'edocument_ubl.msg_company_not_found',
284
+ company=etree.tostring(
285
+ customer_party, pretty_print=True).decode()
286
+ if customer_party else ''))
287
+
275
288
  invoice.reference = root.findtext('./{*}ID')
276
289
  invoice.invoice_date = dt.date.fromisoformat(
277
290
  root.findtext('./{*}IssueDate'))
278
291
  invoice.party = cls._parse_2_supplier(
279
- root.find('./{*}AccountingSupplierParty'), create=True)
292
+ root.find('./{*}AccountingSupplierParty'), create=True).id
280
293
  invoice.set_journal()
281
294
  invoice.on_change_party()
282
295
  invoice.invoice_address = cls._parse_2_address(
@@ -291,17 +304,6 @@ class Invoice(Model):
291
304
  supplier = cls._parse_2_supplier(seller)
292
305
  else:
293
306
  supplier = invoice.party
294
- if (customer_party := root.find('./{*}AccountingCustomerParty')
295
- ) is not None:
296
- invoice.company = cls._parse_2_company(customer_party)
297
- else:
298
- invoice.company = Invoice.default_company()
299
- if not invoice.company:
300
- raise InvoiceError(gettext(
301
- 'edocument_ubl.msg_company_not_found',
302
- company=etree.tostring(
303
- customer_party, pretty_print=True).decode()
304
- if customer_party else ''))
305
307
 
306
308
  if (payee_party := root.find('./{*}PayeeParty')) is not None:
307
309
  party = cls._parse_2_party(payee_party)
@@ -327,6 +329,9 @@ class Invoice(Model):
327
329
 
328
330
  invoice.payment_term_date = cls._parse_2_payment_term_date(
329
331
  root.findall('./{*}PaymentTerms'))
332
+ if not invoice.payment_term_date:
333
+ if due_date := root.findtext('./{*}DueDate'):
334
+ invoice.payment_term_date = dt.date.fromisoformat(due_date)
330
335
  lines = [
331
336
  cls._parse_invoice_2_line(
332
337
  line,
@@ -525,22 +530,31 @@ class Invoice(Model):
525
530
  type_code=type_code))
526
531
 
527
532
  invoice = Invoice(type='in')
533
+
534
+ if (customer_party := root.find('./{*}AccountingCustomerParty')
535
+ ) is not None:
536
+ invoice.company = cls._parse_2_company(customer_party)
537
+ else:
538
+ invoice.company = Invoice.default_company()
539
+ if not invoice.company:
540
+ raise InvoiceError(gettext(
541
+ 'edocument_ubl.msg_company_not_found',
542
+ company=etree.tostring(
543
+ customer_party, pretty_print=True).decode()
544
+ if customer_party else ''))
545
+
528
546
  invoice.reference = root.findtext('./{*}ID')
529
547
  invoice.invoice_date = dt.date.fromisoformat(
530
548
  root.findtext('./{*}IssueDate'))
531
549
  invoice.party = cls._parse_2_supplier(
532
- root.find('./{*}AccountingSupplierParty'), create=True)
550
+ root.find('./{*}AccountingSupplierParty'), create=True).id
533
551
  invoice.set_journal()
534
552
  invoice.on_change_party()
535
553
  if (seller := root.find('./{*}SellerSupplierParty')) is not None:
536
554
  supplier = cls._parse_2_supplier(seller)
537
555
  else:
538
556
  supplier = invoice.party
539
- if (customer_party := root.find('./{*}AccountingCustomerParty')
540
- ) is not None:
541
- invoice.company = cls._parse_2_company(customer_party)
542
- else:
543
- invoice.company = Invoice.default_company()
557
+
544
558
  if (payee_party := root.find('./{*}PayeeParty')) is not None:
545
559
  party = cls._parse_2_party(payee_party)
546
560
  if not party:
@@ -559,6 +573,9 @@ class Invoice(Model):
559
573
  code=currency_code))
560
574
  invoice.payment_term_date = cls._parse_2_payment_term_date(
561
575
  root.findall('./{*}PaymentTerms'))
576
+ if not invoice.payment_term_date:
577
+ if due_date := root.findtext('./{*}DueDate'):
578
+ invoice.payment_term_date = dt.date.fromisoformat(due_date)
562
579
  lines = [
563
580
  cls._parse_credit_note_2_line(
564
581
  line, company=invoice.company, currency=invoice.currency,
@@ -865,9 +882,8 @@ class Invoice(Model):
865
882
  address.building_number = address_el.findtext('./{*}BuildingNumber')
866
883
  address.city = address_el.findtext('./{*}CityName')
867
884
  address.postal_code = address_el.findtext('./{*}PostalZone')
868
- if (country_code := address_el.findtext(
869
- './{*}Country/{*}IdentificationCode[@listId="ISO3166-1"]')
870
- ) is not None:
885
+ if country_code := address_el.findtext(
886
+ './{*}Country/{*}IdentificationCode[@listId="ISO3166-1"]'):
871
887
  try:
872
888
  country, = Country.search([
873
889
  ('code', '=', country_code),
@@ -969,8 +985,7 @@ class Invoice(Model):
969
985
  def _parse_2_payment_term_date(cls, payment_terms):
970
986
  dates = []
971
987
  for payment_term in payment_terms:
972
- if (date := payment_term.findtext('./{*}PaymentDueDate')
973
- ) is not None:
988
+ if date := payment_term.findtext('./{*}PaymentDueDate'):
974
989
  dates.append(dt.date.fromisoformat(date))
975
990
  return min(dates, default=None)
976
991
 
@@ -993,8 +1008,7 @@ class Invoice(Model):
993
1008
  pass
994
1009
  else:
995
1010
  return product
996
- if (code := item.findtext('./{*}BuyersItemIdentification/{*}ID')
997
- ) is not None:
1011
+ if code := item.findtext('./{*}BuyersItemIdentification/{*}ID'):
998
1012
  try:
999
1013
  product, = Product.search([
1000
1014
  ('code', '=', code),
@@ -1086,13 +1100,16 @@ class Invoice(Model):
1086
1100
  ) is not None:
1087
1101
  mime_code = (
1088
1102
  data.get('mimeCode') or 'application/octet-stream')
1089
- name += mimetypes.guess_extension(mime_code) or ''
1103
+ if extension := mimetypes.guess_extension(mime_code):
1104
+ if not name.lower().endswith(extension):
1105
+ name += extension
1090
1106
  attachment.type = 'data'
1091
1107
  data = b64decode(data.text)
1092
1108
  attachment.data = data
1093
1109
  elif data := document.findtext(
1094
1110
  './{*}Attachment/{*}EmbeddedDocument'):
1095
- name += '.txt'
1111
+ if not name.lower().endswith('.txt'):
1112
+ name += '.txt'
1096
1113
  attachment.type = 'data'
1097
1114
  attachment.data = data
1098
1115
  elif url := document.findtext(
@@ -62,7 +62,7 @@ Parse the UBL invoice::
62
62
  >>> with file_open(
63
63
  ... 'edocument_ubl/tests/UBL-CreditNote-2.1-Example.xml',
64
64
  ... mode='rb') as fp:
65
- ... invoice_id = EInvoice.parse(fp.read(), config.context)
65
+ ... invoice_id = EInvoice.parse(fp.read(), {**config.context, 'company': None})
66
66
 
67
67
  >>> invoice = Invoice(invoice_id)
68
68
 
@@ -62,7 +62,7 @@ Parse the UBL invoice::
62
62
  >>> with file_open(
63
63
  ... 'edocument_ubl/tests/UBL-Invoice-2.1-Example.xml',
64
64
  ... mode='rb') as fp:
65
- ... invoice_id = EInvoice.parse(fp.read(), config.context)
65
+ ... invoice_id = EInvoice.parse(fp.read(), {**config.context, 'company': None})
66
66
 
67
67
  >>> invoice = Invoice(invoice_id)
68
68
 
@@ -1,5 +1,5 @@
1
1
  [tryton]
2
- version=7.8.8
2
+ version=7.8.10
3
3
  depends:
4
4
  edocument_unece
5
5
  ir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trytond_edocument_ubl
3
- Version: 7.8.8
3
+ Version: 7.8.10
4
4
  Summary: Tryton module for electronic document UBL
5
5
  Home-page: http://www.tryton.org/
6
6
  Download-URL: http://downloads.tryton.org/7.8/