Skip to content

Commit 73e8e87

Browse files
committed
[IMP] l10n_fr: Display delivery date on invoice
[FIX]: Put all in one file
1 parent 9ae5720 commit 73e8e87

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

addons/l10n_fr_account/models/account_move.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,17 @@ def _get_view(self, view_id=None, view_type='form', **options):
2020
def _compute_l10n_fr_is_company_french(self):
2121
for record in self:
2222
record.l10n_fr_is_company_french = record.country_code in record.company_id._get_france_country_codes()
23+
24+
@api.depends('country_code', 'move_type')
25+
def _compute_show_delivery_date(self):
26+
# EXTENDS 'account'
27+
super()._compute_show_delivery_date()
28+
for move in self:
29+
if move.country_code == 'FR':
30+
move.show_delivery_date = move.is_sale_document()
31+
32+
def _post(self, soft=True):
33+
for move in self:
34+
if move.country_code == 'FR' and move.is_sale_document() and not move.delivery_date:
35+
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
36+
return super()._post(soft)

0 commit comments

Comments
 (0)