Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions addons/l10n_fr_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ def _get_view(self, view_id=None, view_type='form', **options):
def _compute_l10n_fr_is_company_french(self):
for record in self:
record.l10n_fr_is_company_french = record.country_code in record.company_id._get_france_country_codes()

@api.depends('country_code', 'move_type')
def _compute_show_delivery_date(self): #EXTEND 'account'
super()._compute_show_delivery_date()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also when doing extension of compute it's nice to have a comment like # EXTEND 'account'
if you look at the code you should be able to find many example

for move in self:
if move.l10n_fr_is_company_french:
move.show_delivery_date = move.is_sale_document()

def _post(self, soft=True):
post = super()._post(soft)
for move in self:
if move.show_delivery_date and not move.delivery_date:
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
return post