trytond-edocument-ubl 8.0.3__tar.gz → 8.0.4__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.
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/PKG-INFO +2 -2
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/edocument.py +18 -6
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tryton.cfg +1 -1
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/.hgignore +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/COPYRIGHT +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/LICENSE +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/__init__.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/account.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/account.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/document.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/exceptions.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/icons/LICENSE +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/bg.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/ca.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/cs.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/de.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/es.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/es_419.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/et.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/fa.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/fi.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/fr.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/hu.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/id.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/it.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/lo.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/lt.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/nl.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/pl.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/pt.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/ro.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/ru.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/sl.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/tr.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/uk.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/locale/zh_CN.po +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/message.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/party.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/pyproject.toml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/template/2/CreditNote.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/template/2/Invoice.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/template/2/base.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/BDNDR-CCTS_CCT_SchemaModule-1.1.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/BDNDR-UnqualifiedDataTypes-1.1.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-CommonAggregateComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-CommonBasicComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-CommonExtensionComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-CommonSignatureComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-ExtensionContentDataType-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-QualifiedDataTypes-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-SignatureAggregateComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-SignatureBasicComponents-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-XAdES01903v132-201601-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-XAdES01903v141-201601-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-xmldsig-core-schema-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-xmldsig1-schema-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/common/UBL-xmldsig11-schema-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/maindoc/UBL-CreditNote-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/maindoc/UBL-Invoice-2.4.xsd +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/UBL-CreditNote-2.1-Example.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/UBL-Invoice-2.1-Example-Trivial.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/UBL-Invoice-2.1-Example.xml +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/__init__.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_credit_note_parse.json +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_credit_note_parse.rst +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_invoice_parse.json +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_invoice_parse.rst +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_invoice_parse_trivial.rst +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/test_module.py +0 -0
- {trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/test_scenario.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: trytond_edocument_ubl
|
|
3
|
-
Version: 8.0.
|
|
3
|
+
Version: 8.0.4
|
|
4
4
|
Summary: UBL electronic document for Tryton
|
|
5
5
|
Project-URL: homepage, https://www.tryton.org/
|
|
6
6
|
Project-URL: documentation, https://docs.tryton.org/modules-edocument-ubl/
|
|
@@ -382,6 +382,9 @@ class Invoice(Model):
|
|
|
382
382
|
root.findall('./{*}PaymentMeans'), payees=payees)
|
|
383
383
|
invoice.payment_term_date = cls._parse_2_payment_term_date(
|
|
384
384
|
root.findall('./{*}PaymentTerms'))
|
|
385
|
+
if not invoice.payment_term_date:
|
|
386
|
+
if due_date := root.findtext('./{*}DueDate'):
|
|
387
|
+
invoice.payment_term_date = dt.date.fromisoformat(due_date)
|
|
385
388
|
lines = [
|
|
386
389
|
cls._parse_invoice_2_line(
|
|
387
390
|
line,
|
|
@@ -460,7 +463,9 @@ class Invoice(Model):
|
|
|
460
463
|
if (invoiced_quantity := invoice_line.find('./{*}InvoicedQuantity')
|
|
461
464
|
) is not None:
|
|
462
465
|
line.quantity = float(invoiced_quantity.text)
|
|
463
|
-
digits =
|
|
466
|
+
digits = (
|
|
467
|
+
-Decimal(invoiced_quantity.text)
|
|
468
|
+
.normalize().as_tuple().exponent)
|
|
464
469
|
if (unit_code := invoiced_quantity.get('unitCode')) not in {
|
|
465
470
|
None, 'ZZ', 'XZZ'}:
|
|
466
471
|
try:
|
|
@@ -695,6 +700,9 @@ class Invoice(Model):
|
|
|
695
700
|
root.findall('./{*}PaymentMeans'), payees=payees)
|
|
696
701
|
invoice.payment_term_date = cls._parse_2_payment_term_date(
|
|
697
702
|
root.findall('./{*}PaymentTerms'))
|
|
703
|
+
if not invoice.payment_term_date:
|
|
704
|
+
if due_date := root.findtext('./{*}DueDate'):
|
|
705
|
+
invoice.payment_term_date = dt.date.fromisoformat(due_date)
|
|
698
706
|
lines = [
|
|
699
707
|
cls._parse_credit_note_2_line(
|
|
700
708
|
line, company=invoice.company, currency=invoice.currency,
|
|
@@ -771,7 +779,9 @@ class Invoice(Model):
|
|
|
771
779
|
if (credited_quantity := credit_note_line.find('./{*}CreditedQuantity')
|
|
772
780
|
) is not None:
|
|
773
781
|
line.quantity = -float(credited_quantity.text)
|
|
774
|
-
digits =
|
|
782
|
+
digits = (
|
|
783
|
+
-Decimal(credited_quantity.text)
|
|
784
|
+
.normalize().as_tuple().exponent)
|
|
775
785
|
if (unit_code := credited_quantity.get('unitCode')) not in {
|
|
776
786
|
None, 'ZZ', 'XZZ'}:
|
|
777
787
|
try:
|
|
@@ -1188,8 +1198,7 @@ class Invoice(Model):
|
|
|
1188
1198
|
def _parse_2_payment_term_date(cls, payment_terms):
|
|
1189
1199
|
dates = []
|
|
1190
1200
|
for payment_term in payment_terms:
|
|
1191
|
-
if
|
|
1192
|
-
) is not None:
|
|
1201
|
+
if date := payment_term.findtext('./{*}PaymentDueDate'):
|
|
1193
1202
|
dates.append(dt.date.fromisoformat(date))
|
|
1194
1203
|
return min(dates, default=None)
|
|
1195
1204
|
|
|
@@ -1314,13 +1323,16 @@ class Invoice(Model):
|
|
|
1314
1323
|
) is not None:
|
|
1315
1324
|
mime_code = (
|
|
1316
1325
|
data.get('mimeCode') or 'application/octet-stream')
|
|
1317
|
-
|
|
1326
|
+
if extension := mimetypes.guess_extension(mime_code):
|
|
1327
|
+
if not name.lower().endswith(extension):
|
|
1328
|
+
name += extension
|
|
1318
1329
|
attachment.type = 'data'
|
|
1319
1330
|
data = b64decode(data.text)
|
|
1320
1331
|
attachment.data = data
|
|
1321
1332
|
elif data := document.findtext(
|
|
1322
1333
|
'./{*}Attachment/{*}EmbeddedDocument'):
|
|
1323
|
-
|
|
1334
|
+
if not name.lower().endswith('.txt'):
|
|
1335
|
+
name += '.txt'
|
|
1324
1336
|
attachment.type = 'data'
|
|
1325
1337
|
attachment.data = data
|
|
1326
1338
|
elif url := document.findtext(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/maindoc/UBL-CreditNote-2.4.xsd
RENAMED
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/2.4/maindoc/UBL-Invoice-2.4.xsd
RENAMED
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/UBL-CreditNote-2.1-Example.xml
RENAMED
|
File without changes
|
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/UBL-Invoice-2.1-Example.xml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_invoice_parse.json
RENAMED
|
File without changes
|
{trytond_edocument_ubl-8.0.3 → trytond_edocument_ubl-8.0.4}/tests/scenario_ubl_2_invoice_parse.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|