Skip to content
Open
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions addons/l10n_cl/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@
<field name="view_mode">list,form</field>
</record>

<record id="account_invoices_cl" model="ir.actions.report">
<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

<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="attachment"/>
<field name="binding_model_id" ref="model_account_move"/>
<field name="binding_type">report</field>
<field name="domain" eval="[('move_type', '!=', 'entry')]"/>
</record>

<menuitem id="menu_sale_invoices_credit_notes" parent="account.menu_finance_receivables" sequence="3" action="sale_invoices_credit_notes" name="Sale Invoices and Credit Notes (CL)"/>
<menuitem id="menu_vendor_bills_and_refunds" parent="account.menu_finance_payables" sequence="3" action="vendor_bills_and_refunds" name="Vendor Bills and Refunds (CL)"/>

Expand Down
37 changes: 37 additions & 0 deletions addons/l10n_cl/views/report_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@
<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 👀

<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

<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

<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"> 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 ;)

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>
</t>
</xpath>

<t t-call="account.document_tax_totals" position="attributes">
<attribute name="t-call">l10n_cl.tax_totals_widget</attribute>
</t>
Expand All @@ -228,9 +244,30 @@
<t t-if="o._get_name_invoice_report() == 'l10n_cl.report_invoice_document'"
t-call="l10n_cl.report_invoice_document" t-lang="lang"/>
</xpath>
</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)

<t t-set="show_details_box" t-value="True"/>
</t>
</template>

<!-- <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>-->
Comment on lines +255 to +269

Choose a reason for hiding this comment

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

remove


<template id="tax_totals_widget" inherit_id="account.document_tax_totals" primary="True">
<t t-foreach="tax_totals['subtotals']" t-as="subtotal" position="replace">
<t t-set="subtotal_amounts" t-value="o._l10n_cl_get_amounts()"/>
Expand Down