Skip to content

[IMP] l10_fr_account: show delivery date on invoice #4815

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

Open
wants to merge 1 commit into
base: 18.0-rd-accounting-onboarding-malb
Choose a base branch
from
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
20 changes: 20 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,23 @@ 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('invoice_date', 'l10n_fr_is_company_french', 'delivery_date')
def _compute_delivery_date(self):
super()._compute_delivery_date()
for move in self:
if move.invoice_date and move.l10n_fr_is_company_french and not move.delivery_date:
move.delivery_date = move.invoice_date
Comment on lines +23 to +28

Choose a reason for hiding this comment

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

Not needed in the scope of this task, only _compute_show_delivery_date and post are enough 😄


@api.depends('l10n_fr_is_company_french', 'move_type')
def _compute_show_delivery_date(self):
super()._compute_show_delivery_date()
for move in self:
if move.l10n_fr_is_company_french:
move.show_delivery_date = move.is_sale_document()

def _post(self, soft=True):
for move in self:
if move.l10n_fr_is_company_french and move.is_sale_document() and not move.delivery_date:
move.delivery_date = move.invoice_date
return super()._post(soft)