From 77b7f8c94a0cc0cc7409d08aa60ae0da58dbf101 Mon Sep 17 00:00:00 2001 From: "Ahmad (alah)" Date: Thu, 3 Jul 2025 13:45:41 +0200 Subject: [PATCH] [IMP] l10_fr_account: show delivery date on invoice New legislation in France to add delivery date on invoice. task-4908900 --- 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 0040694d77bcb..b89c704bca587 100644 --- a/addons/l10n_fr_account/models/account_move.py +++ b/addons/l10n_fr_account/models/account_move.py @@ -19,3 +19,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('l10n_fr_is_company_french', '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.show_delivery_date and not move.delivery_date: + move.delivery_date = move.invoice_date + return super()._post(soft)