Skip to content

Conversation

@yagho-odoo
Copy link

In chile, if the invoice is yielded physically, a copy with the informational box is required, to be filled if needed by the user, this is for the customers that rely on physical documents, a separate button was created to give the option to either print a normal pdf with no box, or the new pdf with the box
task-5231303

In chile, if the invoice is yielded physically, a copy with the informational box is required, to be filled if needed by the user, this is for the customers that rely on physical documents, a separate button was created to give the option to either print a normal pdf with no box, or the new pdf with the box
task-5231303
@robodoo
Copy link

robodoo commented Nov 13, 2025

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

<field name="report_type">qweb-pdf</field>
<field name="report_name">l10n_cl.report_invoice_document_with_box</field>
<field name="report_file">l10n_cl.report_invoice_document_with_box</field>
<field name="print_report_name">(object._get_report_base_filename())</field>

Choose a reason for hiding this comment

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

We could do an extend of that function to add "COPY" in the name

<field name="name">Invoices with copy</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">l10n_cl.report_invoice_document_with_box</field>

Choose a reason for hiding this comment

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

Name of template could be bit better there ahah

<span t-out="line_amounts['line_description']" t-options="{'widget': 'text'}"/>
</xpath>

<xpath expr="//div[contains(@class, 'invoice_main')]" position="inside">

Choose a reason for hiding this comment

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

Change all the diff to enterprise in l10n_cl_edi since it's something we want for that also xpath could be more precise
check the "stamp" div 👀

</xpath>

<xpath expr="//div[contains(@class, 'invoice_main')]" position="inside">
<t t-if="show_details_box">

Choose a reason for hiding this comment

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

t-if could be added direclty to the div


<xpath expr="//div[contains(@class, 'invoice_main')]" position="inside">
<t t-if="show_details_box">
<div style="position: fixed; width: 45%; right: 3%;">

Choose a reason for hiding this comment

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

You can do everything with boostrap !
Style should be avoided at all cost for multiple reason:

  • Difficult to maintain, using class we can actually modify the class for everything in the code to have consistency, here you cannot
  • Readability: here you have just one styling so ok but you can have a lot and it will become a nightmare
  • Priority: let's say we have a min height in one of the class, the styling will take priority on everything, which you could lead to problematic behavior

<t t-if="show_details_box">
<div style="position: fixed; width: 45%; right: 3%;">
<div style="border: 3px solid black; padding: 1rem;" >
<div style="font-size: 1.5rem"> Nombre : ___________________________________ </div>

Choose a reason for hiding this comment

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

no need for the _____ normally the space should be given by the css not the text 😄

<div style="font-size: 1.5rem"> Nombre : ___________________________________ </div>
<div style="font-size: 1.5rem"> RUT : ______________ FECHA : _______________ </div>
<div style="font-size: 1.5rem"> Recinto : __________ FIRMA : _______________ </div>
<div style="font-size: 1rem"> El acuse de recibo que se declara en este acto, de acuredo a lo dispuesto en la letra b) del art.

Choose a reason for hiding this comment

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

we always put the text in english and then translate it back ;)

Comment on lines +255 to +269
<!-- <template id="report_invoice_details_box" inherit_id="l10n_cl.report_invoice_document" primary="True">-->
<!-- <xpath expr="//div[contains(@class, 'invoice_main')]" position="inside">-->
<!-- <div style="position: fixed; width: 45%; right: 3%;">-->
<!-- <div style="border: 3px solid black; padding: 1rem;" >-->
<!-- <div style="font-size: 1.5rem"> Nombre : ___________________________________ </div>-->
<!-- <div style="font-size: 1.5rem"> RUT : ______________ FECHA : _______________ </div>-->
<!-- <div style="font-size: 1.5rem"> Recinto : __________ FIRMA : _______________ </div>-->
<!-- <div style="font-size: 1rem"> El acuse de recibo que se declara en este acto, de acuredo a lo dispuesto en la letra b) del art. -->
<!-- 4 y la letra c) del Art. 5 de la ley 19.983, acredita que la entrega de mercaderia(s) o servicios -->
<!-- </div>-->
<!-- </div>-->
<!-- <div style="font-size: 1.2rem; text-align: right; margin-right: 2rem; margin-top: 1rem; font-weight: bold;"> CEDIBLE </div>-->
<!-- </div>-->
<!-- </xpath>-->
<!-- </template>-->

Choose a reason for hiding this comment

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

remove

</template>

<template id="report_invoice_document_with_box">
<t t-call="account.report_invoice_document">

Choose a reason for hiding this comment

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

you should call the l10n_cl.report_invoice not the basic account one, the reason is that the report_invoice is overriden by localisation with a mode primary (i will let you look at the doc for that, could be either extension or primary)

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