Skip to content

Commit d6a1812

Browse files
committed
[IMP] account: add delivery date on invoices for France
The new legislation in France imposes to add te deliver date on the invoice. task-5231287
1 parent a2112b3 commit d6a1812

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

addons/l10n_fr_account/models/account_move.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ def _compute_show_delivery_date(self):
2828
for move in self:
2929
if move.l10n_fr_is_company_french:
3030
move.show_delivery_date = move.is_sale_document()
31+
32+
def _post(self, soft=True):
33+
# EXTEND 'account'
34+
to_post = super()._post(soft)
35+
for move in self:
36+
if move.show_delivery_date and not move.delivery_date:
37+
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
38+
return to_post

0 commit comments

Comments
 (0)