Skip to content

Conversation

@jollaib
Copy link

@jollaib jollaib commented Jan 28, 2026

Description of the issue/feature this PR addresses:
Add Delivery date to invoice if the company is spanish
Current behavior before PR:
The Delivery date didn't appear always and sometimes it was not specified.

Desired behavior after PR is merged:
It will always now be specified if it is a spanish company.
Therefore, it will always appear in the invoice.

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link

robodoo commented Jan 28, 2026

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

Copy link

@malb-odoo malb-odoo left a comment

Choose a reason for hiding this comment

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

thanks for the pr 😄 Commit doesn't follow the guidelines btwww
https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html

for move in self:
super()._compute_delivery_date()
if move.country_code == 'ES' and move.state == 'posted' and move.invoice_date and not move.delivery_date:
move.delivery_date == move.invoice_date No newline at end of file

Choose a reason for hiding this comment

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

You can set up you IDE to add an empty line at the end, otherwise you have that everytime ahah

Comment on lines 36 to 40
for move in self:
if move.country_code == 'ES':
move.show_delivery_date = move.is_sale_document()
else:
move.show_delivery_date = move.delivery_date and move.is_sale_document()

Choose a reason for hiding this comment

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

Use a super before the loop so that you don't need the else 😄

@api.depends('state')
def _compute_delivery_date(self):
for move in self:
super()._compute_delivery_date()

Choose a reason for hiding this comment

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

Move the super on top of the loop otherwise you could have a looot of calls to the super

Comment on lines +24 to +33
<template id="external_layout_standard" inherit_id="web.external_layout_standard">
<xpath expr="//div[@name='company_address']" position="after">
<t t-if="o._name == 'account.move'">
<div name="delivery_date">
<p>Delivery Date: <span t-out="o.delivery_date" /></p>
</div>
</t>
</xpath>
</template>
</odoo> No newline at end of file

Choose a reason for hiding this comment

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

Actually this was not needed, the pdf is already good (it was my bad 👀)

@jollaib jollaib force-pushed the 19.0-5867760-l10n_es-delivery-date branch from cbc5cd4 to b12cab2 Compare January 29, 2026 10:34
@jollaib jollaib requested a review from malb-odoo January 29, 2026 10:34
@jollaib jollaib force-pushed the 19.0-5867760-l10n_es-delivery-date branch from b12cab2 to 6d98a43 Compare January 29, 2026 10:43
Copy link

@malb-odoo malb-odoo left a comment

Choose a reason for hiding this comment

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

Few thingssss, also still commit message can be improved 😄



@api.depends('state')
def _compute_delivery_date(self):

Choose a reason for hiding this comment

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

Fine to do it like this but i would expect a extend of the action_post or _post function instead. Here if you do the compute, anyfield that is used in the compute should be in the depends, soooo it means it will be triggered anytime the country code, state, invoice_date is changed which is not really what we want 😄

for move in self:
if move.country_code == 'ES' and move.state == 'posted' and move.invoice_date and not move.delivery_date:
move.delivery_date == move.invoice_date

No newline at end of file

Choose a reason for hiding this comment

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

Weird thing here ahaha, you should have an empty line at the end of the file without space to remove the red circle, so i think you have a tab space in line 48 so if you remove it it should be good

if move.country_code == 'ES':
move.show_delivery_date = move.is_sale_document()


Choose a reason for hiding this comment

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

One extra line that can be removed

Comment on lines -6 to 20
<xpath expr="//div[@id='partner_vat_address_not_same_as_shipping']" position="after">
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'">
ID: <span t-field="o.partner_id.company_registry"/>
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'"> ID: <span
t-field="o.partner_id.company_registry" />
</div>
</xpath>

<xpath expr="//div[@id='partner_vat_address_same_as_shipping']" position="after">
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'">
ID: <span t-field="o.partner_id.company_registry"/>
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'"> ID: <span
t-field="o.partner_id.company_registry" />
</div>
</xpath>

<xpath expr="//div[@id='partner_vat_no_shipping']" position="after">
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'">
ID: <span t-field="o.partner_id.company_registry"/>
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'ES'"> ID: <span
t-field="o.partner_id.company_registry" />
</div>

Choose a reason for hiding this comment

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

Those diffs are not necessary, linter issue ?

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.

4 participants