Skip to content

[IMP] l10n_se: add delivery date to invoice - #5228

Draft
gato-odoo wants to merge 2 commits into
19.0-onboarding-august-malbfrom
19.0-onboarding-add-delivery-date-gato
Draft

[IMP] l10n_se: add delivery date to invoice#5228
gato-odoo wants to merge 2 commits into
19.0-onboarding-august-malbfrom
19.0-onboarding-add-delivery-date-gato

Conversation

@gato-odoo

Copy link
Copy Markdown

Show delivery date on the invoice for the Swedish localisation.

If the invoice is pushed with no delivery date set, automatically set the delivery date to the invoice date instead.
If the invoice date is also not set, fall back to the current date.

task-6438916

Add delivery date to the invoice to comply with Swedish legislation

task-6438916
If an invoice is posted with a delivery date,
automatically set the delivery date to the invoice date.

If the invoice date is not set either, fall back to current date.

task-6438916
@gato-odoo
gato-odoo requested a review from SaddemAmine August 10, 2026 09:13
@robodoo

robodoo commented Aug 10, 2026

Copy link
Copy Markdown

This PR targets the un-managed branch odoo-dev/odoo:19.0-onboarding-august-malb, it needs to be retargeted before it can be merged.

@SaddemAmine SaddemAmine left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Almost there!

Comment on lines +86 to +87


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Extra line here

Comment on lines +88 to +92
def _post(self, soft=True):
for move in self:
if move.country_code == 'SE' and move.is_sale_document() and not move.delivery_date:
move.delivery_date = move.invoice_date or fields.Date.context_today(self)
return super()._post(soft)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's add # EXTENDS here too!

def _post(self, soft=True):
for move in self:
if move.country_code == 'SE' and move.is_sale_document() and not move.delivery_date:
move.delivery_date = move.invoice_date or fields.Date.context_today(self)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job using context_today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants