Skip to content

Commit 77b7f8c

Browse files
committed
[IMP] l10_fr_account: show delivery date on invoice
New legislation in France to add delivery date on invoice. task-4908900
1 parent 6819f50 commit 77b7f8c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

addons/l10n_fr_account/models/account_move.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,16 @@ def _get_view(self, view_id=None, view_type='form', **options):
1919
def _compute_l10n_fr_is_company_french(self):
2020
for record in self:
2121
record.l10n_fr_is_company_french = record.country_code in record.company_id._get_france_country_codes()
22+
23+
@api.depends('l10n_fr_is_company_french', 'move_type')
24+
def _compute_show_delivery_date(self):
25+
super()._compute_show_delivery_date()
26+
for move in self:
27+
if move.l10n_fr_is_company_french:
28+
move.show_delivery_date = move.is_sale_document()
29+
30+
def _post(self, soft=True):
31+
for move in self:
32+
if move.show_delivery_date and not move.delivery_date:
33+
move.delivery_date = move.invoice_date
34+
return super()._post(soft)

0 commit comments

Comments
 (0)