From 8cfd3d612a434e0c24cf14f1fd2dec026d7d07bd Mon Sep 17 00:00:00 2001 From: shzi-odoo Date: Mon, 7 Jul 2025 15:19:22 +0200 Subject: [PATCH] [FIX] account: show delivery date on invoices for French companies Fixed an issue where the delivery date was not displayed on invoices for companies operating in France when the interface language was set to French. The delivery date is now properly fixed. task-4908851 --- addons/l10n_fr_account/models/account_move.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/l10n_fr_account/models/account_move.py b/addons/l10n_fr_account/models/account_move.py index 0040694d77bcb..745cf88e2192b 100644 --- a/addons/l10n_fr_account/models/account_move.py +++ b/addons/l10n_fr_account/models/account_move.py @@ -19,3 +19,17 @@ def _get_view(self, view_id=None, view_type='form', **options): def _compute_l10n_fr_is_company_french(self): for record in self: record.l10n_fr_is_company_french = record.country_code in record.company_id._get_france_country_codes() + + @api.depends('l10n_fr_is_company_french') + def _compute_show_delivery_date(self): + # EXTENDS 'account' + super()._compute_show_delivery_date() + for move in self: + if move.l10n_fr_is_company_french: + move.show_delivery_date = move.is_sale_document() + + def _post(self, soft=True): + for move in self: + if move.show_delivery_date and not move.delivery_date: + move.delivery_date = move.invoice_date or fields.Date.context_today(self) + return super()._post(soft)