From 722ba526c3c80886059a46124bd2764c4b592bf3 Mon Sep 17 00:00:00 2001 From: Wajih-Wanis Date: Tue, 4 Nov 2025 12:49:41 +0100 Subject: [PATCH] [IMP] l10n_fr_account: delivery date added on french invoices as a new legislation in french required the addition of delivery date on invoice s we have to modify the localisation for french companies to always have the deliver y date included in the invoices to comply with the legislation. task : 5231338 --- addons/l10n_fr_account/models/account_move.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/l10n_fr_account/models/account_move.py b/addons/l10n_fr_account/models/account_move.py index ff6f3aca58f49..d0dcae4d697b3 100644 --- a/addons/l10n_fr_account/models/account_move.py +++ b/addons/l10n_fr_account/models/account_move.py @@ -20,3 +20,16 @@ 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('country_code', 'move_type') + def _compute_show_delivery_date(self): + 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.l10_fr_is_company_french and move.is_sale_document() and not move.delivery_date: + move.delivery_date = move.invoice_date or fields.Date.context_today(self) + return super()._post(soft)