Skip to content

Commit 722ba52

Browse files
committed
[IMP] l10n_fr_account: delivery date added on french invoices
as a new legislation in french required the addition of delivery date on invoice s we have to modify the localisation for french companies to always have the deliver y date included in the invoices to comply with the legislation. task : 5231338
1 parent 9ae5720 commit 722ba52

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
@@ -20,3 +20,16 @@ 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+
super()._compute_show_delivery_date()
27+
for move in self:
28+
if move.l10n_fr_is_company_french:
29+
move.show_delivery_date = move.is_sale_document()
30+
31+
def _post(self, soft=True):
32+
for move in self:
33+
if move.l10_fr_is_company_french and move.is_sale_document() and not move.delivery_date:
34+
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
35+
return super()._post(soft)

0 commit comments

Comments
 (0)