Skip to content

[FIX] l10n_fr_account: show delivery date on customer invoice #4808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 18.0-rd-accounting-onboarding-malb
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions addons/l10n_fr_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ 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):
# EXTENDS 'account'
super()._compute_show_delivery_date()
for move in self:
if self.l10n_fr_is_company_french:
move.show_delivery_date = move.is_sale_document()

def _post(self, soft=True):
res = 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 res