diff --git a/addons/l10n_fr_account/models/account_move.py b/addons/l10n_fr_account/models/account_move.py index 0040694d77bcb..dd58beee1eca0 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): + for move in self: + if move.l10n_fr_is_company_french: + move.show_delivery_date = True + + @api.depends('invoice_date', 'show_delivery_date') + def _compute_delivery_date(self): + # EXTENDS 'account' + super()._compute_delivery_date() + for move in self: + if not move.delivery_date and move.show_delivery_date: + move.delivery_date = move.invoice_date