From 5ea2d526a52e1bd8e4a790be6f14c9bce13d1b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Duato=20Catal=C3=A1n?= Date: Mon, 26 Jan 2026 17:11:35 +0100 Subject: [PATCH 1/2] [FIX] l10n_es: add delivery_date to header Added delivery date to invoice header Set delivery date to current date when posting invoices task-5867648 --- addons/l10n_es/__manifest__.py | 1 + addons/l10n_es/models/account_move.py | 5 +++++ addons/l10n_es/views/report_invoice.xml | 4 ++++ addons/l10n_es/views/report_templates.xml | 11 +++++++++++ 4 files changed, 21 insertions(+) create mode 100644 addons/l10n_es/views/report_templates.xml diff --git a/addons/l10n_es/__manifest__.py b/addons/l10n_es/__manifest__.py index c13345aa50f80..bafd45eed89e0 100644 --- a/addons/l10n_es/__manifest__.py +++ b/addons/l10n_es/__manifest__.py @@ -37,6 +37,7 @@ 'views/account_tax_views.xml', 'data/product_data.xml', 'views/report_invoice.xml', + 'views/report_templates.xml', 'views/res_config_settings_views.xml', 'data/mod111.xml', 'data/mod115.xml', diff --git a/addons/l10n_es/models/account_move.py b/addons/l10n_es/models/account_move.py index 5116bacce3373..8decf71f8058a 100644 --- a/addons/l10n_es/models/account_move.py +++ b/addons/l10n_es/models/account_move.py @@ -29,3 +29,8 @@ 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()) + + def _post(self, soft=True): + posted = super()._post(soft=soft) + posted.filtered(lambda m: not m.delivery_date).delivery_date = fields.Date.context_today(self) + return posted diff --git a/addons/l10n_es/views/report_invoice.xml b/addons/l10n_es/views/report_invoice.xml index 3fc7e8bbb3229..ce7fa5ea8202b 100644 --- a/addons/l10n_es/views/report_invoice.xml +++ b/addons/l10n_es/views/report_invoice.xml @@ -19,5 +19,9 @@ ID: + + + + diff --git a/addons/l10n_es/views/report_templates.xml b/addons/l10n_es/views/report_templates.xml new file mode 100644 index 0000000000000..1bb8d06dc0be5 --- /dev/null +++ b/addons/l10n_es/views/report_templates.xml @@ -0,0 +1,11 @@ + + + + From 1127488290f1e465f062a74350c5dcfe11626b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Duato=20Catal=C3=A1n?= Date: Wed, 28 Jan 2026 16:29:14 +0100 Subject: [PATCH 2/2] [FIX] l10n_es: add delivery_date to header - PR changes --- addons/l10n_es/models/account_move.py | 10 ++++++---- addons/l10n_es/views/report_invoice.xml | 1 + addons/l10n_es/views/report_templates.xml | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/l10n_es/models/account_move.py b/addons/l10n_es/models/account_move.py index 8decf71f8058a..d98ed99aa4d3a 100644 --- a/addons/l10n_es/models/account_move.py +++ b/addons/l10n_es/models/account_move.py @@ -30,7 +30,9 @@ 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()) - def _post(self, soft=True): - posted = super()._post(soft=soft) - posted.filtered(lambda m: not m.delivery_date).delivery_date = fields.Date.context_today(self) - return posted + @api.depends('state') + def _compute_delivery_date(self): + # EXTENDS 'account' + super()._compute_delivery_date() + for move in self.filtered(lambda m: not m.delivery_date and m.state == 'posted'): + move.delivery_date = move.invoice_date diff --git a/addons/l10n_es/views/report_invoice.xml b/addons/l10n_es/views/report_invoice.xml index ce7fa5ea8202b..3c187831e06af 100644 --- a/addons/l10n_es/views/report_invoice.xml +++ b/addons/l10n_es/views/report_invoice.xml @@ -21,6 +21,7 @@ + diff --git a/addons/l10n_es/views/report_templates.xml b/addons/l10n_es/views/report_templates.xml index 1bb8d06dc0be5..fd668c370ee14 100644 --- a/addons/l10n_es/views/report_templates.xml +++ b/addons/l10n_es/views/report_templates.xml @@ -3,7 +3,7 @@