-
Notifications
You must be signed in to change notification settings - Fork 117
[IMP] l10n_cl: add a button to print an invoice with extra info box #4880
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
base: 18.0-rd-accounting-onboarding-malb
Are you sure you want to change the base?
[IMP] l10n_cl: add a button to print an invoice with extra info box #4880
Conversation
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
|
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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%;"> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 ;)
| <!-- <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>--> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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)
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