[IMP] l10n_latam_invoice_document: custom reports

port foward from 13.0 branch, also remove the logic of _get_name_invoice_report()
method already added in account module and remove the not needed latam
report templates.
This commit is contained in:
Katherine Zaoral
2020-08-17 14:09:18 +00:00
parent f6935ef81a
commit 1c5ca6a16d
5 changed files with 118 additions and 48 deletions
@@ -33,8 +33,8 @@ If your localization needs this logic will then need to add this module as depen
'views/account_move_line_view.xml',
'views/account_move_view.xml',
'views/l10n_latam_document_type_view.xml',
'views/report_invoice.xml',
'views/ir_sequence_view.xml',
'views/report_templates.xml',
'report/invoice_report_view.xml',
'wizards/account_move_reversal_view.xml',
'security/ir.model.access.csv',
+13 -9
View File
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.3alpha1+e\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-30 18:44+0000\n"
"PO-Revision-Date: 2020-03-30 18:44+0000\n"
@@ -38,10 +38,10 @@ msgid ""
"identify the kind of document we are working with. (not only related to "
"account.move, could be for documents of other models like stock.picking)"
msgstr ""
"Análogo a al campo Tipo en la factura pero con mas opciones permitiendo "
"indentificar el tipo de documento con el que estamos trabajando (no solo "
"relacionado a la factura, puede ser para documentos de otros modelos como "
"los movimientos de inventario)."
"Análogo a account.move.type de Odoo pero con más opciones, permitiendo "
"identificar el tipo de documento sobre el que estamos trabajando. (no "
"solamente relativo a account.move, podría ser relativo a otros modelos, como"
" por ejemplo stock.picking)"
#. module: l10n_latam_invoice_document
#: model_terms:ir.ui.view,arch_db:l10n_latam_invoice_document.view_document_type_filter
@@ -70,10 +70,14 @@ msgstr "País"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code"
msgstr "Código País"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code (LATAM)"
msgstr "Código País (LATAM)"
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country in which this type of document is valid"
@@ -359,7 +363,7 @@ msgstr ""
#: code:addons/l10n_latam_invoice_document/models/account_move.py:0
#, python-format
msgid "We do not accept the usage of document types on receipts yet. "
msgstr "Aun no aceptamos el uso de tipos de documentos en recepciones"
msgstr "Todavía no aceptamos el uso de tipos de documentos en los recibos."
#. module: l10n_latam_invoice_document
#: code:addons/l10n_latam_invoice_document/models/account_journal.py:0
@@ -391,5 +395,5 @@ msgid ""
"You can only reverse documents with legal invoicing documents from Latin America one at a time.\n"
"Problematic documents: %s"
msgstr ""
"Sólo puedes revertir un documento a la vez para aquellos documentos de America Latina.\n"
"Documentos problemáticos: %s"
"Solo puede revertir documentos con documentos de facturación legales de Latino américa de uno en uno.\n"
"Documentos problemáticos:%s"
@@ -66,10 +66,14 @@ msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_journal__l10n_latam_country_code
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,field_description:l10n_latam_invoice_document.field_account_move__l10n_latam_country_code
msgid "Country Code (LATAM)"
msgstr ""
#. module: l10n_latam_invoice_document
#: model:ir.model.fields,help:l10n_latam_invoice_document.field_l10n_latam_document_type__country_id
msgid "Country in which this type of document is valid"
@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//h2" position="attributes">
<attribute name="t-if">not o.l10n_latam_document_type_id.report_name</attribute>
</xpath>
<xpath expr="//h2" position="after">
<h2 t-if="o.l10n_latam_document_type_id.report_name">
<span t-field="o.l10n_latam_document_type_id.report_name"/>
</h2>
</xpath>
<xpath expr="//span[@t-field='line.price_unit']" position="attributes">
<attribute name="t-field">line.l10n_latam_price_unit</attribute>
</xpath>
<xpath expr="//span[@id='line_tax_ids']" position="attributes">
<attribute name="t-esc">', '.join(map(lambda x: (x.description or x.name), line.l10n_latam_tax_ids))</attribute>
</xpath>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" position="attributes">
<attribute name="t-value">current_subtotal + line.l10n_latam_price_subtotal</attribute>
</t>
<span t-field="line.price_subtotal" position="attributes">
<attribute name="t-field">line.l10n_latam_price_subtotal</attribute>
</span>
<span t-field="o.amount_untaxed" position="attributes">
<attribute name="t-field">o.l10n_latam_amount_untaxed</attribute>
</span>
</template>
</odoo>
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="external_layout_standard" inherit_id="web.external_layout_standard" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_clean" inherit_id="web.external_layout_clean" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout">
<div class="o_clean_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_boxed" inherit_id="web.external_layout_boxed" >
<!-- support for custom header -->
<div t-attf-class="header o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
<div t-attf-class="header o_company_#{company.id}_layout" >
<div class="o_boxed_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" position="after">
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
</template>
<template id="external_layout_background" inherit_id="web.external_layout_background" >
<!-- support for custom header -->
<div t-attf-class="o_company_#{company.id}_layout header" position="attributes">
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout header" position="after">
<div t-attf-class="o_company_#{company.id}_layout header">
<div class="o_background_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
</div>
</div>
<!-- support for custom footer -->
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" position="attributes">
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" position="after">
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
</template>
</odoo>