From fc9809e2fc2d826617d73a8a45108ba63c10634e Mon Sep 17 00:00:00 2001 From: jordi-josc Date: Wed, 28 Jan 2026 11:46:23 +0000 Subject: [PATCH] [ADD]l10n_es: add delivery date - Delivery date in the header of account.move report - Change the logic of the field delivery_date to always display it and fill it with info when it's empty --- addons/l10n_es/__manifest__.py | 1 + addons/l10n_es/models/account_move.py | 8 ++++++++ addons/l10n_es/views/account_move_views.xml | 3 +++ addons/l10n_es/views/report_invoice.xml | 17 +++++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/addons/l10n_es/__manifest__.py b/addons/l10n_es/__manifest__.py index c13345aa50f80..7ae38f6f4bd05 100644 --- a/addons/l10n_es/__manifest__.py +++ b/addons/l10n_es/__manifest__.py @@ -27,6 +27,7 @@ 'base_iban', 'base_vat', 'account_edi_ubl_cii', + 'web' ], 'auto_install': ['account'], 'data': [ diff --git a/addons/l10n_es/models/account_move.py b/addons/l10n_es/models/account_move.py index 5116bacce3373..437a35f8884d9 100644 --- a/addons/l10n_es/models/account_move.py +++ b/addons/l10n_es/models/account_move.py @@ -29,3 +29,11 @@ def _compute_l10n_es_is_simplified(self): def _l10n_es_is_dua(self): self.ensure_one() return any(t.l10n_es_type == 'dua' for t in self.invoice_line_ids.tax_ids.flatten_taxes_hierarchy()) + + @api.depends('state') + def _compute_delivery_date(self): + super()._compute_delivery_date() + for record in self: + if record.state == 'posted' and not record.delivery_date: + record.delivery_date = record.invoice_date + \ No newline at end of file diff --git a/addons/l10n_es/views/account_move_views.xml b/addons/l10n_es/views/account_move_views.xml index 9ac07b1c7b67e..cec3c2bc76861 100644 --- a/addons/l10n_es/views/account_move_views.xml +++ b/addons/l10n_es/views/account_move_views.xml @@ -5,6 +5,9 @@ account.move + + + diff --git a/addons/l10n_es/views/report_invoice.xml b/addons/l10n_es/views/report_invoice.xml index 3fc7e8bbb3229..891ef86764917 100644 --- a/addons/l10n_es/views/report_invoice.xml +++ b/addons/l10n_es/views/report_invoice.xml @@ -1,5 +1,22 @@ + + + +