Skip to content

Commit c49978e

Browse files
committed
[FIX] l10n_fr_account: show delivery date on customer invoice
Purpose ------- Comply with new French legislation requiring the delivery date to appear on customer invoices. This aims to increase transparency for buyers and meet legal obligations. Changes ------- - Added a `delivery_date` field in the invoice form for companies based in France. - Field is editable by the user and shown in the invoice header. - If no delivery date is provided, the invoice date is used as default. - Delivery date is also printed on the invoice layout (PDF report). - Aligned implementation with similar use cases in other localisations. How to test ----------- 1. Set the company country to France. 2. Go to Accounting > Customers > Invoices. 3. Open or create a customer invoice. 4. A new "Delivery Date" field should appear in the form header. 5. Leave it empty or set a specific date. 6. Save and print the invoice. 7. The delivery date should appear in the invoice header, defaulting to the invoice date if not manually set.
1 parent 6819f50 commit c49978e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

addons/l10n_fr_account/models/account_move.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@ 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('country_code', 'move_type')
24+
def _compute_show_delivery_date(self):
25+
# EXTENDS 'account'
26+
super()._compute_show_delivery_date()
27+
for move in self:
28+
if move.country_code == 'FR':
29+
move.show_delivery_date = move.is_sale_document()
30+
31+
def _post(self, soft=True):
32+
res = super()._post(soft)
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 res

0 commit comments

Comments
 (0)