From 2cf1b25dad71df291619c01563adb1a63e1e915b Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Wed, 20 May 2026 16:15:59 +0200 Subject: [PATCH] COO adj --- modules/account_invoice/invoice_melya.fodt | 2 +- modules/purchase_trade/sale.py | 6 +- modules/purchase_trade/tests/test_module.py | 7 +- modules/stock/coo.fodt | 517 +++++++++++++------- modules/stock/coo_.fodt | 204 ++++++++ 5 files changed, 549 insertions(+), 187 deletions(-) create mode 100644 modules/stock/coo_.fodt diff --git a/modules/account_invoice/invoice_melya.fodt b/modules/account_invoice/invoice_melya.fodt index 5d1e1a5..ae5f9a1 100644 --- a/modules/account_invoice/invoice_melya.fodt +++ b/modules/account_invoice/invoice_melya.fodt @@ -1665,7 +1665,7 @@ <pc['label']> - <format_number(pc['amount'], invoice.party.lang) if pc['amount'] is not None else ''> + <pc.get('amount_text', '')> diff --git a/modules/purchase_trade/sale.py b/modules/purchase_trade/sale.py index ba1fb5c..8048ee4 100755 --- a/modules/purchase_trade/sale.py +++ b/modules/purchase_trade/sale.py @@ -887,9 +887,13 @@ class Sale(metaclass=PoolMeta): currency_name, ] if part) if label: + amount = Decimal(str(price or 0)) lines.append({ 'label': label, - 'amount': Decimal(str(price or 0)), + 'amount': amount, + 'amount_text': self._format_report_number( + amount, digits='0.01', + strip_trailing_zeros=False), }) return lines diff --git a/modules/purchase_trade/tests/test_module.py b/modules/purchase_trade/tests/test_module.py index 893ec1f..3dfc417 100644 --- a/modules/purchase_trade/tests/test_module.py +++ b/modules/purchase_trade/tests/test_module.py @@ -2619,10 +2619,15 @@ class PurchaseTradeTestCase(ModuleTestCase): self.assertEqual( sale.report_price_composition_rows, [ - {'label': 'FOB value in EUR', 'amount': Decimal('2500')}, + { + 'label': 'FOB value in EUR', + 'amount': Decimal('2500'), + 'amount_text': '2500.00', + }, { 'label': 'FREIGHT value in EUR', 'amount': Decimal('59993.75'), + 'amount_text': '59993.75', }, ]) diff --git a/modules/stock/coo.fodt b/modules/stock/coo.fodt index 918d571..68bb4c2 100644 --- a/modules/stock/coo.fodt +++ b/modules/stock/coo.fodt @@ -1,204 +1,353 @@ - - - LibreOffice - - Codex - 2026-04-23T00:00:00 - 2026-04-23T00:00:00 - 1 - PT0S - - - - - - - - - - - + + 2026-05-20T16:14:38.9470000002026-05-20T16:15:01.919000000PT23S1LibreOffice/7.6.0.3$Windows_X86_64 LibreOffice_project/69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265 + + + 0 + 0 + 33556 + 16921 + true + false + + + view2 + 9442 + 2501 + 0 + 0 + 33554 + 16919 + 0 + 0 + false + 130 + false + false + false + false + false + false + + + + + true + + true + false + false + false + true + 1 + true + false + false + true + + false + + false + false + false + + 0 + false + true + true + false + false + false + + 0 + + true + high-resolution + false + false + false + false + true + false + false + true + false + false + true + true + false + true + false + false + true + true + false + false + false + false + false + false + false + false + false + 1752128 + 1752128 + false + false + false + true + false + false + true + true + false + true + true + false + false + false + false + false + true + false + true + false + false + false + false + false + true + 0 + true + false + false + true + 0 + true + false + true + true + true + true + false + false + false + false + false + true + + false + true + false + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + - - - + + - - - + + - - - + + + + + + + + + + + + + + + + - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + <records[0].report_coo_exporter or ''> - - - - - + + + <records[0].report_coo_consignee or ''> - - - - - + + + <records[0].report_coo_origin_country or ''> - - - - - + + + <records[0].report_coo_transport or ''> - - - - - + + + <records[0].report_coo_observations or ''> - - - - - + + + <records[0].report_coo_goods_description or ''> - - - - - + + + <records[0].report_coo_net_weight or ''> - - - - - + + + <records[0].report_coo_weight_unit or ''> - - - - - + + + + <records[0].report_coo_weight_unit or ''> + + + <records[0].report_coo_gross_weight or ''> - - - - - - <records[0].report_coo_weight_unit or ''> - - - - - + + + <records[0].report_coo_issue_date or ''> - - - - - - + + + + + \ No newline at end of file diff --git a/modules/stock/coo_.fodt b/modules/stock/coo_.fodt new file mode 100644 index 0000000..918d571 --- /dev/null +++ b/modules/stock/coo_.fodt @@ -0,0 +1,204 @@ + + + + + LibreOffice + + Codex + 2026-04-23T00:00:00 + 2026-04-23T00:00:00 + 1 + PT0S + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <records[0].report_coo_exporter or ''> + + + + + + <records[0].report_coo_consignee or ''> + + + + + + <records[0].report_coo_origin_country or ''> + + + + + + <records[0].report_coo_transport or ''> + + + + + + <records[0].report_coo_observations or ''> + + + + + + <records[0].report_coo_goods_description or ''> + + + + + + <records[0].report_coo_net_weight or ''> + + + + + + <records[0].report_coo_weight_unit or ''> + + + + + + <records[0].report_coo_gross_weight or ''> + + + + + + <records[0].report_coo_weight_unit or ''> + + + + + + <records[0].report_coo_issue_date or ''> + + + + + +