Skip to content

[IMP] l10n_fr_account: Delivery Date in Invoice Header #4817

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

Closed
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 @@ -19,3 +19,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('l10n_fr_is_company_french')
def _compute_show_delivery_date(self):
for move in self:
if move.l10n_fr_is_company_french:
move.show_delivery_date = True

@api.depends('invoice_date', 'show_delivery_date')
def _compute_delivery_date(self):
# EXTENDS 'account'
super()._compute_delivery_date()
for move in self:
if not move.delivery_date and move.show_delivery_date:
move.delivery_date = move.invoice_date