Skip to content

Commit 1752c62

Browse files
committed
[IMP] l10n_fr_account: display delivery date on customer invoices
New legislation in France requires the delivery date to be clearly displayed on customer invoices. Previously, this date was not exposed on the invoice form view or in the printed invoice layout for French localization. This commit updates the invoice form view to display the 'delivery_date' field and integrates the date into the printable invoice report for French localization, ensuring compliance with the new legal requirement. task-5231313
1 parent 9ae5720 commit 1752c62

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

addons/l10n_fr_account/models/account_move.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ def _get_view(self, view_id=None, view_type='form', **options):
1616
shipping_fields[0].attrib.pop("groups", None)
1717
return arch, view
1818

19+
@api.depends('country_code', 'move_type')
20+
def _compute_show_delivery_date(self):
21+
# EXTENDS 'account'
22+
super()._compute_show_delivery_date()
23+
for move in self:
24+
if move.l10n_fr_is_company_french:
25+
move.show_delivery_date = move.is_sale_document()
26+
27+
def _post(self, soft=True):
28+
# EXTENDS 'account'
29+
posted = super()._post(soft)
30+
for move in self:
31+
if move.show_delivery_date and not move.delivery_date:
32+
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
33+
return posted
34+
1935
@api.depends('company_id.country_code')
2036
def _compute_l10n_fr_is_company_french(self):
2137
for record in self:

0 commit comments

Comments
 (0)