From c5113b19dc149bbbb7b26c824fa83bcad966d422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 13 Feb 2026 18:27:14 +0100 Subject: [PATCH] Add UNCL4461 code to invoice payment mean --- modules/edocument_unece/CHANGELOG | 1 + modules/edocument_unece/account.py | 22 ++++++++++++++++++++++ modules/edocument_unece/tryton.cfg | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/modules/edocument_unece/CHANGELOG b/modules/edocument_unece/CHANGELOG index b3f22d3460..885a42ef96 100644 --- a/modules/edocument_unece/CHANGELOG +++ b/modules/edocument_unece/CHANGELOG @@ -1,3 +1,4 @@ +* Add UNCL4461 code to invoice payment mean * Add allowance, charge and special service code Version 7.8.0 - 2025-12-15 diff --git a/modules/edocument_unece/account.py b/modules/edocument_unece/account.py index 073be9bc27..4a2aa91496 100644 --- a/modules/edocument_unece/account.py +++ b/modules/edocument_unece/account.py @@ -132,3 +132,25 @@ class TaxTemplate(metaclass=PoolMeta): if not tax or getattr(tax, field) != getattr(self, field): value[field] = getattr(self, field) return value + + +class InvoicePaymentMean(metaclass=PoolMeta): + __name__ = 'account.invoice.payment.mean' + + @property + def unece_code(self): + "UNCL4461" + if self.instrument.__name__ == 'bank.account': + if self.invoice.type == 'out': + return '30' + else: + return '31' + elif self.instrument.__name__ == 'party.party.reception_direct_debit': + process_method = self.instrument.journal.process_method + if process_method == 'sepa': + if self.invoice.type == 'in': + return '58' + else: + return '59' + else: + return '49' diff --git a/modules/edocument_unece/tryton.cfg b/modules/edocument_unece/tryton.cfg index 125b60f0a6..956d8c0231 100644 --- a/modules/edocument_unece/tryton.cfg +++ b/modules/edocument_unece/tryton.cfg @@ -6,6 +6,8 @@ depends: ir party product +extras_depend: + account_invoice xml: product.xml account.xml @@ -18,3 +20,7 @@ model: product.Product account.TaxTemplate account.Tax + +[register account_invoice] +model: + account.InvoicePaymentMean