trytond-edocument-ubl 7.8.5__tar.gz → 7.8.7__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.5 → trytond_edocument_ubl-7.8.7}/CHANGELOG +10 -0
  2. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/PKG-INFO +1 -1
  3. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/edocument.py +14 -18
  4. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/template/2/CreditNote.xml +7 -5
  5. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/template/2/Invoice.xml +7 -5
  6. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/test_module.py +1 -1
  7. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tryton.cfg +1 -1
  8. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/PKG-INFO +1 -1
  9. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/COPYRIGHT +0 -0
  10. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/LICENSE +0 -0
  11. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/MANIFEST.in +0 -0
  12. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/README.rst +0 -0
  13. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/__init__.py +0 -0
  14. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/account.py +0 -0
  15. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/account.xml +0 -0
  16. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/doc/conf.py +0 -0
  17. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/doc/design.rst +0 -0
  18. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/doc/index.rst +0 -0
  19. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/doc/releases.rst +0 -0
  20. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/doc/requirements-doc.txt +0 -0
  21. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/document.py +0 -0
  22. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/exceptions.py +0 -0
  23. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/icons/LICENSE +0 -0
  24. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/bg.po +0 -0
  25. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/ca.po +0 -0
  26. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/cs.po +0 -0
  27. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/de.po +0 -0
  28. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/es.po +0 -0
  29. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/es_419.po +0 -0
  30. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/et.po +0 -0
  31. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/fa.po +0 -0
  32. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/fi.po +0 -0
  33. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/fr.po +0 -0
  34. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/hu.po +0 -0
  35. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/id.po +0 -0
  36. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/it.po +0 -0
  37. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/lo.po +0 -0
  38. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/lt.po +0 -0
  39. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/nl.po +0 -0
  40. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/pl.po +0 -0
  41. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/pt.po +0 -0
  42. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/ro.po +0 -0
  43. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/ru.po +0 -0
  44. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/sl.po +0 -0
  45. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/tr.po +0 -0
  46. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/uk.po +0 -0
  47. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/locale/zh_CN.po +0 -0
  48. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/message.xml +0 -0
  49. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/party.py +0 -0
  50. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/setup.cfg +0 -0
  51. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/setup.py +0 -0
  52. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/template/2/base.xml +0 -0
  53. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/BDNDR-CCTS_CCT_SchemaModule-1.1.xsd +0 -0
  54. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/BDNDR-UnqualifiedDataTypes-1.1.xsd +0 -0
  55. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-CommonAggregateComponents-2.4.xsd +0 -0
  56. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-CommonBasicComponents-2.4.xsd +0 -0
  57. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-CommonExtensionComponents-2.4.xsd +0 -0
  58. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-CommonSignatureComponents-2.4.xsd +0 -0
  59. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-ExtensionContentDataType-2.4.xsd +0 -0
  60. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-QualifiedDataTypes-2.4.xsd +0 -0
  61. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-SignatureAggregateComponents-2.4.xsd +0 -0
  62. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-SignatureBasicComponents-2.4.xsd +0 -0
  63. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-XAdES01903v132-201601-2.4.xsd +0 -0
  64. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-XAdES01903v141-201601-2.4.xsd +0 -0
  65. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-xmldsig-core-schema-2.4.xsd +0 -0
  66. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-xmldsig1-schema-2.4.xsd +0 -0
  67. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/common/UBL-xmldsig11-schema-2.4.xsd +0 -0
  68. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/maindoc/UBL-CreditNote-2.4.xsd +0 -0
  69. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/2.4/maindoc/UBL-Invoice-2.4.xsd +0 -0
  70. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/UBL-CreditNote-2.1-Example.xml +0 -0
  71. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/UBL-Invoice-2.1-Example-Trivial.xml +0 -0
  72. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/UBL-Invoice-2.1-Example.xml +0 -0
  73. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/__init__.py +0 -0
  74. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/scenario_ubl_2_credit_note_parse.json +0 -0
  75. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/scenario_ubl_2_credit_note_parse.rst +0 -0
  76. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/scenario_ubl_2_invoice_parse.json +0 -0
  77. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/scenario_ubl_2_invoice_parse.rst +0 -0
  78. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/scenario_ubl_2_invoice_parse_trivial.rst +0 -0
  79. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tests/test_scenario.py +0 -0
  80. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/tox.ini +0 -0
  81. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/SOURCES.txt +0 -0
  82. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/dependency_links.txt +0 -0
  83. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/entry_points.txt +0 -0
  84. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/not-zip-safe +0 -0
  85. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/requires.txt +0 -0
  86. {trytond_edocument_ubl-7.8.5 → trytond_edocument_ubl-7.8.7}/trytond_edocument_ubl.egg-info/top_level.txt +0 -0
@@ -1,4 +1,14 @@
1
1
 
2
+ Version 7.8.7 - 2026-03-18
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.8.6 - 2026-03-02
8
+ --------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.8.5 - 2026-02-01
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.5
3
+ Version: 7.8.7
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/
@@ -176,25 +176,29 @@ class Invoice(Model):
176
176
  @cached_property
177
177
  def sale_reference(self):
178
178
  if hasattr(self.invoice, 'sales'):
179
- return ','.join(s.reference for s in self.invoice.sales)
179
+ return ','.join(
180
+ filter(None, (s.reference for s in self.invoice.sales)))
180
181
 
181
182
  @cached_property
182
183
  def sale_number(self):
183
184
  if hasattr(self.invoice, 'sales'):
184
- return ','.join(s.number for s in self.invoice.sales)
185
+ return ','.join(
186
+ filter(None, (s.number for s in self.invoice.sales)))
185
187
 
186
188
  @property
187
189
  def taxes(self):
188
190
  class Tax(namedtuple(
189
191
  'Tax',
190
- ('type', 'rate', 'unece_category_code', 'unece_code'))):
192
+ ('type', 'rate', 'unece_category_code', 'unece_code',
193
+ 'legal_notice'))):
191
194
  @classmethod
192
195
  def from_line(cls, line):
193
196
  return Tax(
194
197
  type=line.tax.type,
195
198
  rate=line.tax.rate,
196
199
  unece_category_code=line.tax.unece_category_code,
197
- unece_code=line.tax.unece_code)
200
+ unece_code=line.tax.unece_code,
201
+ legal_notice=line.legal_notice or '')
198
202
  TaxLine = namedtuple('TaxLine', ('base', 'amount', 'tax'))
199
203
  for group, lines in groupby(sorted(
200
204
  self.invoice.taxes,
@@ -432,13 +436,9 @@ class Invoice(Model):
432
436
  if line.origin:
433
437
  break
434
438
 
435
- if (price_amount := invoice_line.findtext('./{*}Price/{*}PriceAmount')
436
- ) is not None:
437
- line.unit_price = round_price(Decimal(price_amount))
438
- else:
439
- line.unit_price = round_price(
440
- Decimal(invoice_line.findtext('./{*}LineExtensionAmount'))
441
- / Decimal(str(line.quantity)))
439
+ line.unit_price = round_price(
440
+ Decimal(invoice_line.findtext('./{*}LineExtensionAmount'))
441
+ / Decimal(str(line.quantity or 1)))
442
442
 
443
443
  if invoice_line.find('./{*}Item/{*}ClassifiedTaxCategory') is not None:
444
444
  tax_categories = invoice_line.iterfind(
@@ -667,13 +667,9 @@ class Invoice(Model):
667
667
  if line.origin:
668
668
  break
669
669
 
670
- if (price_amount := credit_note_line.findtext(
671
- './{*}Price/{*}PriceAmount')) is not None:
672
- line.unit_price = round_price(Decimal(price_amount))
673
- else:
674
- line.unit_price = round_price(
675
- Decimal(credit_note_line.findtext('./{*}LineExtensionAmount'))
676
- / line.quantity)
670
+ line.unit_price = round_price(
671
+ -Decimal(credit_note_line.findtext('./{*}LineExtensionAmount'))
672
+ / Decimal(str(line.quantity or -1)))
677
673
 
678
674
  if (credit_note_line.find('./{*}Item/{*}ClassifiedTaxCategory')
679
675
  is not None):
@@ -74,6 +74,7 @@ this repository contains the full copyright notices and license terms. -->
74
74
  <cac:TaxCategory>
75
75
  <cbc:ID py:if="line.tax.unece_category_code">${line.tax.unece_category_code}</cbc:ID>
76
76
  <cbc:Percent py:if="line.tax.type == 'percentage'">${format((line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
77
+ <cbc:TaxExemptionReason py:if="line.tax.legal_notice">${line.tax.legal_notice}</cbc:TaxExemptionReason>
77
78
  <cac:TaxScheme py:if="line.tax.unece_code">
78
79
  <cbc:ID>${line.tax.unece_code}</cbc:ID>
79
80
  </cac:TaxScheme>
@@ -106,11 +107,12 @@ this repository contains the full copyright notices and license terms. -->
106
107
  </cac:StandardItemIdentification>
107
108
  </py:with>
108
109
  </py:if>
109
- <cac:ClassifiedTaxCategory py:for="tax in line.taxes">
110
- <cbc:ID py:if="tax.unece_category_code">${tax.unece_category_code}</cbc:ID>
111
- <cbc:Percent py:if="tax.type == 'percentage'">${format((tax.rate * 100).normalize(), 'f')}</cbc:Percent>
112
- <cac:TaxScheme py:if="tax.unece_code">
113
- <cbc:ID>${tax.unece_code}</cbc:ID>
110
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
111
+ <cbc:ID py:if="tax_line.tax.unece_category_code">${tax_line.tax.unece_category_code}</cbc:ID>
112
+ <cbc:Percent py:if="tax_line.tax.type == 'percentage'">${format((tax_line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
113
+ <cbc:TaxExemptionReason py:if="tax_line.tax.legal_notice">${tax_line.tax.legal_notice}</cbc:TaxExemptionReason>
114
+ <cac:TaxScheme py:if="tax_line.tax.unece_code">
115
+ <cbc:ID>${tax_line.tax.unece_code}</cbc:ID>
114
116
  </cac:TaxScheme>
115
117
  </cac:ClassifiedTaxCategory>
116
118
  </cac:Item>
@@ -74,6 +74,7 @@ this repository contains the full copyright notices and license terms. -->
74
74
  <cac:TaxCategory>
75
75
  <cbc:ID py:if="line.tax.unece_category_code">${line.tax.unece_category_code}</cbc:ID>
76
76
  <cbc:Percent py:if="line.tax.type == 'percentage'">${format((line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
77
+ <cbc:TaxExemptionReason py:if="line.tax.legal_notice">${line.tax.legal_notice}</cbc:TaxExemptionReason>
77
78
  <cac:TaxScheme py:if="line.tax.unece_code">
78
79
  <cbc:ID>${line.tax.unece_code}</cbc:ID>
79
80
  </cac:TaxScheme>
@@ -106,11 +107,12 @@ this repository contains the full copyright notices and license terms. -->
106
107
  </cac:StandardItemIdentification>
107
108
  </py:with>
108
109
  </py:if>
109
- <cac:ClassifiedTaxCategory py:for="tax in line.taxes">
110
- <cbc:ID py:if="tax.unece_category_code">${tax.unece_category_code}</cbc:ID>
111
- <cbc:Percent py:if="tax.type == 'percentage'">${format((tax.rate * 100).normalize(), 'f')}</cbc:Percent>
112
- <cac:TaxScheme py:if="tax.unece_code">
113
- <cbc:ID>${tax.unece_code}</cbc:ID>
110
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
111
+ <cbc:ID py:if="tax_line.tax.unece_category_code">${tax_line.tax.unece_category_code}</cbc:ID>
112
+ <cbc:Percent py:if="tax_line.tax.type == 'percentage'">${format((tax_line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
113
+ <cbc:TaxExemptionReason py:if="tax_line.tax.legal_notice">${tax_line.tax.legal_notice}</cbc:TaxExemptionReason>
114
+ <cac:TaxScheme py:if="tax_line.tax.unece_code">
115
+ <cbc:ID>${tax_line.tax.unece_code}</cbc:ID>
114
116
  </cac:TaxScheme>
115
117
  </cac:ClassifiedTaxCategory>
116
118
  </cac:Item>
@@ -98,7 +98,7 @@ def get_invoice():
98
98
  unit_price=Decimal('100.0000'),
99
99
  amount=Decimal('100.00'),
100
100
  description="Description",
101
- taxes=[t.tax for t in taxes],
101
+ invoice_taxes=taxes,
102
102
  )]
103
103
  invoice = MagicMock(spec=Invoice,
104
104
  id=-1,
@@ -1,5 +1,5 @@
1
1
  [tryton]
2
- version=7.8.5
2
+ version=7.8.7
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.5
3
+ Version: 7.8.7
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/