diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_cl/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/l10n_cl/views')
| -rw-r--r-- | addons/l10n_cl/views/account_move_view.xml | 98 | ||||
| -rw-r--r-- | addons/l10n_cl/views/account_tax_view.xml | 48 | ||||
| -rw-r--r-- | addons/l10n_cl/views/ir_sequence_view.xml | 26 | ||||
| -rw-r--r-- | addons/l10n_cl/views/l10n_latam_document_type_view.xml | 13 | ||||
| -rw-r--r-- | addons/l10n_cl/views/report_invoice.xml | 210 | ||||
| -rw-r--r-- | addons/l10n_cl/views/res_bank_view.xml | 28 | ||||
| -rw-r--r-- | addons/l10n_cl/views/res_config_settings_view.xml | 20 | ||||
| -rw-r--r-- | addons/l10n_cl/views/res_country_view.xml | 29 | ||||
| -rw-r--r-- | addons/l10n_cl/views/res_partner.xml | 24 |
9 files changed, 496 insertions, 0 deletions
diff --git a/addons/l10n_cl/views/account_move_view.xml b/addons/l10n_cl/views/account_move_view.xml new file mode 100644 index 00000000..2d588cfe --- /dev/null +++ b/addons/l10n_cl/views/account_move_view.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="view_move_form_inherit_l10n_cl" model="ir.ui.view"> + <field name="name">account.move.form.inherit.l10n.cl</field> + <field name="model">account.move</field> + <field name="inherit_id" ref="account.view_move_form"/> + <field name="arch" type="xml"> + <form> + <field name="l10n_latam_internal_type" invisible="1"/> + </form> + <field name="ref" position="attributes"> + <attribute name="attrs">{'invisible': [('move_type', '=', 'out_invoice'), ('l10n_latam_internal_type', '!=', 'debit_note')], 'required': [('l10n_latam_internal_type', '=', 'debit_note')]}</attribute> + </field> + </field> + </record> + + <record id="view_latam_form_inherit_l10n_cl" model="ir.ui.view"> + <field name="name">account.move.latam.form.inherit.l10n.cl</field> + <field name="model">account.move</field> + <field name="inherit_id" ref="l10n_latam_invoice_document.view_move_form"/> + <field name="arch" type="xml"> + <field name="l10n_latam_document_number" position="attributes"> + <attribute name="attrs">{ + 'invisible': [ + '|', + ('l10n_latam_use_documents', '=', False), + ('l10n_latam_manual_document_number', '=', False), + '|', '|', + ('l10n_latam_use_documents', '=', False), + ('highest_name', '!=', False), + ('state', '!=', 'draft'), + '|', '|', '|', + ('l10n_latam_use_documents', '=', False), + ('posted_before', '=', False), + ('state', '!=', 'draft'), + ('country_code', '!=', 'CL') + ], + 'readonly': [('posted_before', '=', True), ('state', '!=', 'draft')], + 'required': ['|', ('l10n_latam_manual_document_number', '=', True), ('highest_name', '=', False)]} + </attribute> + </field> + </field> + </record> + + <record id="view_complete_invoice_refund_tree" model="ir.ui.view"> + <field name="name">account.move.tree2</field> + <field name="model">account.move</field> + <field name="arch" type="xml"> + <tree decoration-info="state == 'draft'" default_order="create_date" string="Invoices and Refunds" decoration-muted="state == 'cancel'" js_class="account_tree"> + <field name="l10n_latam_document_type_id_code"/> + <field name="l10n_latam_document_number" string="Folio"/> + <field name="partner_id_vat"/> + <field name="partner_id"/> + <field name="invoice_date" optional="show"/> + <field name="invoice_date_due" optional="show"/> + <field name="date" string="Accounting Date" optional="show"/> + <field name="payment_reference" optional="hide"/> + <field name="invoice_user_id" optional="show" invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund','out_receipt')" string="Sales Person"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" optional="show"/> + <field name="invoice_origin" optional="show" string="Source Document"/> + <field name="amount_untaxed_signed" string="Amount Untaxed" sum="Total" optional="show"/> + <field name="amount_tax_signed" string="Tax" sum="Total" optional="show"/> + <field name="amount_total_signed" string="Total" sum="Total" optional="show"/> + <field name="amount_residual_signed" string="Amount Due" sum="Amount Due" optional="show"/> + <field name="currency_id" invisible="1"/> + <field name="company_currency_id" invisible="1"/> + <field name="state" optional="show"/> + <field name="payment_state" optional="hide"/> + <field name="move_type" invisible="context.get('default_move_type', True)"/> + </tree> + </field> + </record> + + <record model="ir.actions.act_window" id="sale_invoices_credit_notes"> + <field name="name">Sale Invoices and Credit Notes</field> + <field name="view_id" ref="view_complete_invoice_refund_tree"/> + <field name="res_model">account.move</field> + <field name="domain">[('move_type', 'in', ['out_invoice', 'out_refund'])]</field> + <field name="context">{'default_move_type': 'out_invoice'}</field> + <field name="target">current</field> + <field name="view_mode">tree,form</field> + </record> + + <record model="ir.actions.act_window" id="vendor_bills_and_refunds"> + <field name="name">Vendor Bills and Refunds</field> + <field name="view_id" ref="view_complete_invoice_refund_tree"/> + <field name="res_model">account.move</field> + <field name="domain">[('move_type', 'in', ['in_invoice', 'in_refund'])]</field> + <field name="context">{'default_move_type': 'in_invoice'}</field> + <field name="target">current</field> + <field name="view_mode">tree,form</field> + </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)"/> + +</odoo> diff --git a/addons/l10n_cl/views/account_tax_view.xml b/addons/l10n_cl/views/account_tax_view.xml new file mode 100644 index 00000000..051c7c01 --- /dev/null +++ b/addons/l10n_cl/views/account_tax_view.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + <record id="view_account_tax_form" model="ir.ui.view"> + <field name="name">account.tax.form</field> + <field name="model">account.tax</field> + <field name="inherit_id" ref="account.view_tax_form"/> + <field name="arch" type="xml"> + <field name="name" position="after"> + <field name="l10n_cl_sii_code" options="{'format': false}"/> + </field> + </field> + </record> + + <record id="view_tax_sii_code_tree" model="ir.ui.view"> + <field name="name">account.tax.sii.code.tree</field> + <field name="model">account.tax</field> + <field name="inherit_id" ref="account.view_tax_tree" /> + <field name="arch" type="xml"> + <field name="name" position="before"> + <field name="l10n_cl_sii_code" options="{'format': false}"/> + </field> + </field> + </record> + + <record id="view_account_tax_template_form" model="ir.ui.view"> + <field name="name">account.tax.template.form</field> + <field name="model">account.tax.template</field> + <field name="inherit_id" ref="account.view_account_tax_template_form"/> + <field name="arch" type="xml"> + <field name="name" position="after"> + <field name="l10n_cl_sii_code" options="{'format': false}"/> + </field> + </field> + </record> + + <record id="view_account_tax_template_tree" model="ir.ui.view"> + <field name="name">account.tax.template.sii.tree</field> + <field name="model">account.tax.template</field> + <field name="inherit_id" ref="account.view_account_tax_template_tree" /> + <field name="arch" type="xml"> + <field name="name" position="before"> + <field name="l10n_cl_sii_code" options="{'format': false}"/> + </field> + </field> + </record> + </data> +</odoo>
\ No newline at end of file diff --git a/addons/l10n_cl/views/ir_sequence_view.xml b/addons/l10n_cl/views/ir_sequence_view.xml new file mode 100644 index 00000000..6964642f --- /dev/null +++ b/addons/l10n_cl/views/ir_sequence_view.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="sequence_view" model="ir.ui.view"> + <field name="name">ir.sequence.form</field> + <field name="model">ir.sequence</field> + <field name="inherit_id" ref="l10n_latam_invoice_document.sequence_view"/> + <field name="arch" type="xml"> + <field name="l10n_latam_document_type_id" position="after"> + <field name="l10n_cl_journal_ids" widget="many2many_tags"/> + </field> + </field> + </record> + + <record id="view_sequence_search" model="ir.ui.view"> + <field name="name">ir.sequence.search</field> + <field name="model">ir.sequence</field> + <field name="inherit_id" ref="l10n_latam_invoice_document.view_sequence_search"/> + <field name="arch" type="xml"> + <field name="code" position="before"> + <field name="l10n_cl_journal_ids"/> + </field> + </field> + </record> + +</odoo> diff --git a/addons/l10n_cl/views/l10n_latam_document_type_view.xml b/addons/l10n_cl/views/l10n_latam_document_type_view.xml new file mode 100644 index 00000000..3d518e1d --- /dev/null +++ b/addons/l10n_cl/views/l10n_latam_document_type_view.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="l10n_cl_latam_document_type_view" model="ir.ui.view"> + <field name="name">l10n.cl.latam.document.type.view</field> + <field name="model">l10n_latam.document.type</field> + <field name="inherit_id" ref="l10n_latam_invoice_document.view_document_type_form"/> + <field name="arch" type="xml"> + <field name="sequence" position="attributes"> + <attribute name="widget">handle</attribute> + </field> + </field> + </record> +</odoo> diff --git a/addons/l10n_cl/views/report_invoice.xml b/addons/l10n_cl/views/report_invoice.xml new file mode 100644 index 00000000..c2692ff3 --- /dev/null +++ b/addons/l10n_cl/views/report_invoice.xml @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <!-- this header can be used on any Chilean report --> + <template id="custom_header"> + + <t t-set="report_date" t-value="o.invoice_date"/> + <t t-set="report_number" t-value="int(o.l10n_latam_document_number)"/> + <t t-set="pre_printed_report" t-value="report_type == 'pdf'"/> + <t t-set="report_name" t-value="o.l10n_latam_document_type_id.name"/> + <t t-set="header_address" t-value="o.company_id.partner_id"/> + <t t-set="custom_footer"> + <t t-call="l10n_cl.custom_footer"/> + </t> + + <div> + <div class="row"> + <div name="left-upper-side" class="col-8"> + <img t-if="o.company_id.logo" t-att-src="image_data_uri(o.company_id.logo)" + style="max-height: 45px;" alt="Logo"/> + <br/> + <strong> + <span t-field="o.company_id.partner_id.name"/> + </strong> + <br/> + <span name="company_activity" class="font-italic" t-field="o.company_id.report_header"/> + <div/> + <t t-esc="' - '.join([item for item in [ + ', '.join([item for item in [header_address.street, header_address.street2] if item]), + header_address.city, + header_address.state_id and header_address.state_id.name, + header_address.zip, + header_address.country_id and header_address.country_id.name] if item])"/> + <span t-if="header_address.phone"> + <br/> + </span> + <span t-if="header_address.phone" style="white-space: nowrap;" + t-esc="'Tel: ' + header_address.phone"/> + <span t-if="header_address.website"> + <span t-att-style="'color: %s;' % o.company_id.primary_color" + t-esc="'- Web: %s' %' - '.join([item for item in [header_address.website.replace('https://', '').replace('http://', ''), header_address.email] if item])"/> + </span> + </div> + <div name="right-upper-side" class="col-4"> + <div class="row"> + <div name="right-upper-side" class="col-12"> + <div class="row border border-dark"> + <div class="col-12 text-center"> + <h6 t-att-style="'color: %s;' % o.company_id.primary_color"> + <strong t-att-style="'color: %s;' % o.company_id.primary_color"> + <br/> + <span style="line-height: 180%;">RUT:</span> + <span t-esc="o.company_id.partner_id._format_dotted_vat_cl(o.company_id.partner_id.vat)"/> + <br/> + <span class="text-uppercase" t-esc="report_name"/> + <br/> + <span>Nº:</span> + <span style="line-height: 200%;" t-esc="report_number"/> + </strong> + </h6> + </div> + </div> + <div class="row text-center"> + <div class="col-12 text-center" t-att-style="'color: %s;' % o.company_id.primary_color" + name="regional-office"/> + </div> + </div> + </div> + </div> + + </div> + + </div> + </template> + + + <template id="informations"> + <div id="informations" class="row mt8 mb8"> + <div class="col-6"> + <strong> + <span t-att-style="'color: %s;' % o.company_id.secondary_color">Date:</span> + </strong> + <span t-esc="o.invoice_date" t-options='{"widget": "date"}'/> + <br/> + + <strong>Customer:</strong> + <span t-field="o.partner_id.name"/> + <br/> + + <t t-if="o.partner_id.vat and o.partner_id.l10n_latam_identification_type_id"> + <strong> + <t t-esc="o.partner_id.l10n_latam_identification_type_id.name or o.company_id.country_id.vat_label" id="inv_tax_id_label"/>: + </strong> + <span t-esc="o.partner_id.vat"/> + <br/> + </t> + <strong>GIRO:</strong> + <span t-esc="o.partner_id.industry_id.name or ''"/> + <br/> + </div> + <div class="col-6"> + <strong>Due Date:</strong> + <span t-esc="o.invoice_date_due" t-options='{"widget": "date"}'/> + <br/> + <strong>Address:</strong> + <span t-field="o.partner_id" + t-options="{'widget': 'contact', 'fields': ['address'], 'no_marker': true, 'no_tag_br': True}"/> + + <strong>Payment Terms:</strong> + <span t-esc="o.invoice_payment_term_id.name or ''"/> + + + <t t-if="o.invoice_incoterm_id"> + <br/> + <strong>Incoterm:</strong> + <span t-field="o.invoice_incoterm_id.name"/> + </t> + + </div> + </div> + <div id="references" class="row"> + <div name="references" class="col-12 text-center"/> + </div> + </template> + + <template id="custom_footer"> + <div name="footer_left_column" class="col-8 text-center"/> + </template> + + <template id="report_invoice_document" inherit_id="account.report_invoice_document" primary="True"> + + <t t-set="o" position="after"> + <t t-set="custom_header" t-value="'l10n_cl.custom_header'"/> + </t> + + <!-- remove default partner address --> + <t t-set="address" position="replace"/> + + <xpath expr="//h2" position="replace"/> + + <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> + + <xpath expr="//th[@name='th_subtotal']/span[@groups='account.group_show_line_subtotals_tax_included']" position="replace"> + <span groups="account.group_show_line_subtotals_tax_included">Amount</span> + </xpath> + + <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> + + <xpath expr="//th[@name='th_taxes']" position="replace"/> + <xpath expr="//span[@id='line_tax_ids']/.." position="replace"/> + + <p name="payment_term" position="replace"/> + <xpath expr="//span[@t-field='o.payment_reference']/../.." position="replace"/> + + <!-- replace information section and usage chilean style --> + <div id="informations" position="replace"> + <t t-call="l10n_cl.informations"/> + </div> + + <!-- we remove the ml auto and also give more space to avoid multiple lines on tax detail --> + <xpath expr="//div[@id='total']/div" position="attributes"> + <attribute name="t-attf-class">#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'}</attribute> + </xpath> + + <xpath expr="//div[@id='total']/div" position="before"> + <div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'}"/> + </xpath> + + <xpath expr="//div[@id='total']" position="after"> + <div class="row"> + <div name="stamp" class="col-4 text-center"/> + <div name="transferable-table" class="col-4"/> + <div name="transferable-legend" class="col-4 pull-right"/> + </div> + </xpath> + + </template> + + <!-- FIXME: Temp fix to allow fetching invoice_documemt in Studio Reports with localisation --> + <template id="report_invoice" inherit_id="account.report_invoice"> + <xpath expr='//t[@t-call="account.report_invoice_document"]' position="after"> + <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_with_payments" inherit_id="account.report_invoice_with_payments"> + <xpath expr='//t[@t-call="account.report_invoice_document"]' position="after"> + <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> + +</odoo> diff --git a/addons/l10n_cl/views/res_bank_view.xml b/addons/l10n_cl/views/res_bank_view.xml new file mode 100644 index 00000000..653180a0 --- /dev/null +++ b/addons/l10n_cl/views/res_bank_view.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record model="ir.ui.view" id="view_res_bank_form"> + <field name="name">res.bank.form</field> + <field name="model">res.bank</field> + <field name="inherit_id" ref="base.view_res_bank_form" /> + <field name="arch" type="xml"> + <field name="name" position="before"> + <field name="l10n_cl_sbif_code" /> + </field> + </field> + </record> + + <record model="ir.ui.view" id="view_res_bank_tree"> + <field name="name">bank.bank.tree</field> + <field name="model">res.bank</field> + <field name="inherit_id" ref="base.view_res_bank_tree" /> + <field name="arch" type="xml"> + <field name="name" position="before"> + <field name="l10n_cl_sbif_code" /> + </field> + </field> + </record> + + </data> +</odoo>
\ No newline at end of file diff --git a/addons/l10n_cl/views/res_config_settings_view.xml b/addons/l10n_cl/views/res_config_settings_view.xml new file mode 100644 index 00000000..ad7d6d10 --- /dev/null +++ b/addons/l10n_cl/views/res_config_settings_view.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.chilean.loc</field> + <field name="model">res.config.settings</field> + <field name="inherit_id" ref="account.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//div[@id='invoicing_settings']" position="after"> + <div id="l10n_cl_title" attrs="{'invisible': True}"> + <h2>Chilean Localization</h2> + </div> + <div id="l10n_cl_section" class="row mt16 o_settings_container" attrs="{'invisible': [('country_code', '!=', 'CL')]}"> + <!-- inside empty to add configuration of tags --> + </div> + </xpath> + </field> + </record> + +</odoo> diff --git a/addons/l10n_cl/views/res_country_view.xml b/addons/l10n_cl/views/res_country_view.xml new file mode 100644 index 00000000..4879b79c --- /dev/null +++ b/addons/l10n_cl/views/res_country_view.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="view_res_country_form" model="ir.ui.view"> + <field name="name">res.country.form</field> + <field name="model">res.country</field> + <field name="inherit_id" ref="base.view_country_form"/> + <field name="arch" type="xml"> + <field name="code" position="after"> + <field name="l10n_cl_customs_name"/> + <field name="l10n_cl_customs_code"/> + <field name="l10n_cl_customs_abbreviation"/> + </field> + </field> + </record> + + <record id="view_res_country_tree" model="ir.ui.view"> + <field name="name">res.country.tree</field> + <field name="model">res.country</field> + <field name="inherit_id" ref="base.view_country_tree"/> + <field name="arch" type="xml"> + <field name="code" position="after"> + <field name="l10n_cl_customs_name"/> + <field name="l10n_cl_customs_code"/> + <field name="l10n_cl_customs_abbreviation"/> + </field> + </field> + </record> +</odoo>
\ No newline at end of file diff --git a/addons/l10n_cl/views/res_partner.xml b/addons/l10n_cl/views/res_partner.xml new file mode 100644 index 00000000..18fb48af --- /dev/null +++ b/addons/l10n_cl/views/res_partner.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="view_move_form" model="ir.ui.view"> + <field name="name">res.partner.placeholders.l10n_cl.form</field> + <field name="inherit_id" ref="base.view_partner_form"/> + <field name="model">res.partner</field> + <field name="arch" type="xml"> + <field name="street2" position="attributes"> + <attribute name="placeholder">Datos adic. dirección y Ciudad</attribute> + </field> + <field name="city" position="attributes"> + <attribute name="attrs">{'placeholder': 'Comuna'}</attribute> + </field> + <field name="state_id" position="attributes"> + <attribute name="placeholder">Región</attribute> + </field> + <field name="vat" position="after"> + <field name="l10n_cl_sii_taxpayer_type" attrs="{'readonly': [('parent_id', '!=', False)]}" placeholder="Tax Payer Type"/> + </field> + </field> + </record> + +</odoo> |
