Skip to content

Commit e04f46b

Browse files
committed
[IMP] l10n_fr: Display delivery date on invoice
1 parent 9ae5720 commit e04f46b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

addons/l10n_fr/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
from . import res_partner
55
from . import res_company
6+
from . import account_move
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from odoo import models, api, fields
2+
3+
class AccountMove(models.Model):
4+
_inherit = 'account.move'
5+
6+
@api.depends('country_code', 'move_type')
7+
def _compute_show_delivery_date(self):
8+
# EXTENDS 'account'
9+
super()._compute_show_delivery_date()
10+
for move in self:
11+
if move.country_code == 'FR':
12+
move.show_delivery_date = move.is_sale_document()
13+
14+
def _post(self, soft=True):
15+
for move in self:
16+
if move.country_code == 'FR' and move.is_sale_document() and not move.delivery_date:
17+
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
18+
return super()._post(soft)

0 commit comments

Comments
 (0)