diff options
| author | Daniel Blanco <daniel@blancomartin.cl> | 2019-12-02 12:34:52 +0000 |
|---|---|---|
| committer | Ravi Gohil <rgo@odoo.com> | 2020-06-16 13:28:00 +0000 |
| commit | f3a66dd65d041ffc7367d85d5603e9627efb9f2b (patch) | |
| tree | dc11f51312c633dd4896ce0be4691170e9774bf0 /addons | |
| parent | d85ed5151436be8e17fd7999db5f180c33d3b99b (diff) | |
[FIX] l10n_cl: Several fixes and improvements for l10n_cl
[FIX] l10n_cl: format RUT/VAT as used in Chile (99999999-X)
[FIX] l10n_cl: prevent errors with domain of available documents in invoice view.
[FIX] l10n_cl: allow to select document types when partner is empty
[ADD] l10n_cl: add ILA taxes (purchase and sale) and assign account to taxes
[ADD] l10n_cl: add fiscal position exempt for purchases and sales
[IMP] l10n_cl: configure accounts used in inventory valuation
[FIX] l10n_cl prevent to put unneeded sales documents in sales journal
[FIX] l10n_cl limit revision of document types and partner constrains only for sale and purchase journals
[FIX] l10n_cl: add extra validation to know wether there is a latam_document_type_code selected
[ADD] l10n_cl: add document type '801' Orden de compra
[WIP] add tag to costo de ventas account
[FIX] l10n_cl: fiscal position templates: fix supermarket tax
[FIX] l10n_cl: change order for boletas
[WIP] l10n_cl: fix the compute document types method
[FIX] l10n_cl: prevent expected singleton error (checked in tests) in post
[I18N] l10n_cl: add new translations
[I18N] l10n_cl: reduce size of taxes names and abbreviation for invoices (probably more work to add here)
[FIX] l10n_cl: remove countries from accounts
[FIX] l10n_cl: remove recalc of domain when journal changes
[FIX] l10n_cl: remove sale constraint
closes odoo/odoo#53068
X-original-commit: 060f083879f6094941f746928832fec253a23bb0
Signed-off-by: Josse Colpaert <jco@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/l10n_cl/data/account_fiscal_template.xml | 50 | ||||
| -rw-r--r-- | addons/l10n_cl/data/account_tax_data.xml | 189 | ||||
| -rw-r--r-- | addons/l10n_cl/data/l10n_cl_chart_data.xml | 15 | ||||
| -rw-r--r-- | addons/l10n_cl/data/l10n_latam.document.type.csv | 15 | ||||
| -rw-r--r-- | addons/l10n_cl/data/res_partner.xml | 3 | ||||
| -rw-r--r-- | addons/l10n_cl/i18n/es.po | 286 | ||||
| -rw-r--r-- | addons/l10n_cl/i18n/l10n_cl.pot | 104 | ||||
| -rw-r--r-- | addons/l10n_cl/models/account_journal.py | 6 | ||||
| -rw-r--r-- | addons/l10n_cl/models/account_move.py | 87 | ||||
| -rw-r--r-- | addons/l10n_cl/models/account_tax.py | 2 | ||||
| -rw-r--r-- | addons/l10n_cl/models/res_partner.py | 32 |
11 files changed, 622 insertions, 167 deletions
diff --git a/addons/l10n_cl/data/account_fiscal_template.xml b/addons/l10n_cl/data/account_fiscal_template.xml index 2b6f358a3ce..06bf25d667e 100644 --- a/addons/l10n_cl/data/account_fiscal_template.xml +++ b/addons/l10n_cl/data/account_fiscal_template.xml @@ -9,7 +9,7 @@ <record id="afpt_non_recoverable_vat_1_tax" model="account.fiscal.position.tax.template"> <field name="position_id" ref="l10n_cl.afpt_non_recoverable_vat_1"/> <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> - <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_no_recup"/> + <field name="tax_dest_id" ref="l10n_cl.iva_compra_no_recup"/> </record> <record id="afpt_non_recoverable_vat_2" model="account.fiscal.position.template"> @@ -19,7 +19,7 @@ <record id="afpt_non_recoverable_vat_2_tax" model="account.fiscal.position.tax.template"> <field name="position_id" ref="afpt_non_recoverable_vat_2"/> <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> - <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_no_recup"/> + <field name="tax_dest_id" ref="l10n_cl.iva_compra_no_recup"/> </record> <record id="afpt_non_recoverable_vat_3" model="account.fiscal.position.template"> @@ -29,7 +29,7 @@ <record id="afpt_non_recoverable_vat_3_tax" model="account.fiscal.position.tax.template"> <field name="position_id" ref="afpt_non_recoverable_vat_3"/> <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> - <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_no_recup"/> + <field name="tax_dest_id" ref="l10n_cl.iva_compra_no_recup"/> </record> <record id="afpt_non_recoverable_vat_4" model="account.fiscal.position.template"> @@ -39,8 +39,18 @@ <record id="afpt_non_recoverable_vat_4_tax" model="account.fiscal.position.tax.template"> <field name="position_id" ref="afpt_non_recoverable_vat_4"/> <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> - <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_no_recup"/> + <field name="tax_dest_id" ref="l10n_cl.iva_compra_no_recup"/> + </record> + <record id="afpt_non_recoverable_vat_4_account_1" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_non_recoverable_vat_4"/> + <field name="account_src_id" ref="l10n_cl.account_410235"/> + <field name="account_dest_id" ref="l10n_cl.account_410165"/> </record> + <record id="afpt_non_recoverable_vat_4_account_2" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_non_recoverable_vat_4"/> + <field name="account_src_id" ref="l10n_cl.account_410230"/> + <field name="account_dest_id" ref="l10n_cl.account_410165"/> + </record> <record id="afpt_non_recoverable_vat_9" model="account.fiscal.position.template"> <field name="name">Compras - Otros</field> @@ -49,7 +59,7 @@ <record id="afpt_non_recoverable_vat_9_tax" model="account.fiscal.position.tax.template"> <field name="position_id" ref="afpt_non_recoverable_vat_9"/> <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> - <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_no_recup"/> + <field name="tax_dest_id" ref="l10n_cl.iva_compra_no_recup"/> </record> <record id="afpt_fixed_asset" model="account.fiscal.position.template"> @@ -61,6 +71,16 @@ <field name="tax_src_id" ref="l10n_cl.OTAX_19"/> <field name="tax_dest_id" ref="l10n_cl.iva_activo_fijo_uso_comun"/> </record> + <record id="afpt_fixed_asset_account_1" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_fixed_asset"/> + <field name="account_src_id" ref="l10n_cl.account_410230"/> + <field name="account_dest_id" ref="l10n_cl.account_121140"/> + </record> + <record id="afpt_fixed_asset_account_2" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_fixed_asset"/> + <field name="account_src_id" ref="l10n_cl.account_410235"/> + <field name="account_dest_id" ref="l10n_cl.account_121140"/> + </record> <record id="afpt_purchase_exempt" model="account.fiscal.position.template"> <field name="name">Compras - Exentas</field> @@ -76,6 +96,26 @@ <field name="account_dest_id" ref="l10n_cl.account_410130"/> </record> + <record id="afpt_purchase_supermarket" model="account.fiscal.position.template"> + <field name="name">Compras - Supermercado</field> + <field name="chart_template_id" ref="l10n_cl.cl_chart_template"/> + </record> + <record id="afpt_purchase_supermarket_tax" model="account.fiscal.position.tax.template"> + <field name="position_id" ref="afpt_purchase_supermarket"/> + <field name="tax_src_id" ref="l10n_cl.ITAX_19"/> + <field name="tax_dest_id" ref="l10n_cl.iva_supermercado_recup"/> + </record> + <record id="afpt_purchase_supermarket_account" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_purchase_supermarket"/> + <field name="account_src_id" ref="l10n_cl.account_410230"/> + <field name="account_dest_id" ref="l10n_cl.account_410233"/> + </record> + <record id="afpt_purchase_supermarket_account_1" model="account.fiscal.position.account.template"> + <field name="position_id" ref="afpt_purchase_supermarket"/> + <field name="account_src_id" ref="l10n_cl.account_410235"/> + <field name="account_dest_id" ref="l10n_cl.account_410233"/> + </record> + <record id="afpt_sale_exempt" model="account.fiscal.position.template"> <field name="name">Ventas - Exentas</field> <field name="chart_template_id" ref="l10n_cl.cl_chart_template"/> diff --git a/addons/l10n_cl/data/account_tax_data.xml b/addons/l10n_cl/data/account_tax_data.xml index 22e2a4b2d42..13c7ece44c2 100644 --- a/addons/l10n_cl/data/account_tax_data.xml +++ b/addons/l10n_cl/data/account_tax_data.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> - <!-- Account Tags --> + + <!-- Account Tags --> <record id="ITAX_19" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> <field name="name">IVA 19% Venta</field> - <field name="description">IVA 19% Venta</field> + <field name="description">IVA 19% Vta</field> <field name="amount">19</field> <field name="amount_type">percent</field> <field name="type_tax_use">sale</field> @@ -42,7 +43,7 @@ <record id="OTAX_19" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> <field name="name">IVA 19% Compra</field> - <field name="description">IVA 19% Compra</field> + <field name="description">IVA 19% Comp</field> <field name="amount">19</field> <field name="amount_type">percent</field> <field name="type_tax_use">purchase</field> @@ -78,8 +79,8 @@ <record id="I_IU2C" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">Retención de Segunda Categoría</field> - <field name="description">Retención de Segunda Categoría</field> + <field name="name">Ret. 2da Categoría</field> + <field name="description">Ret. 2da Cat</field> <field name="amount">-10.75</field> <field name="sequence" eval="2"/> <field name="amount_type">percent</field> @@ -117,7 +118,7 @@ <record id="especifico_compra" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> <field name="name">Específico Compra</field> - <field name="description">Especifico</field> + <field name="description">Espec. Comp</field> <field name="amount">63</field> <field name="amount_type">percent</field> <field name="type_tax_use">purchase</field> @@ -150,7 +151,7 @@ <record id="iva_activo_fijo" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">IVA Compra - 19% Activo Fijo</field> + <field name="name">IVA Compra 19% Activo Fijo</field> <field name="description">IVA 19% ActF</field> <field name="amount">19</field> <field name="amount_type">percent</field> @@ -175,12 +176,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_compras_activo_fijo')], + 'minus_report_line_ids': [ref('tax_report_compras_activo_fijo')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo')], + 'minus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo')], 'account_id': ref('account_110730'), }), ]"/> @@ -188,7 +189,7 @@ <record id="iva_activo_fijo_uso_comun" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">IVA Compra - 19% Activo Fijo Uso Común</field> + <field name="name">IVA Compra 19% Act. Fijo Uso Común</field> <field name="description">IVA 19% ActFUC</field> <field name="amount">19</field> <field name="amount_type">percent</field> @@ -213,12 +214,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_compras_activo_fijo_uso_comun')], + 'minus_report_line_ids': [ref('tax_report_compras_activo_fijo_uso_comun')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo_uso_comun')], + 'minus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo_uso_comun')], 'account_id': ref('account_110730'), }), ]"/> @@ -226,7 +227,7 @@ <record id="iva_activo_fijo_uso_no_recup" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">IVA Compra - 19% Activo Fijo No Recuperable</field> + <field name="name">IVA Compra 19% Activo Fijo No Recup</field> <field name="description">IVA 19% ActFNR</field> <field name="amount">19</field> <field name="amount_type">percent</field> @@ -244,27 +245,27 @@ 'factor_percent': 100, 'repartition_type': 'tax', 'plus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo_no_recup')], - 'account_id': ref('account_110730'), + 'account_id': ref('account_420220'), }), ]"/> <field name="refund_repartition_line_ids" eval="[(5, 0, 0), (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_compras_activo_fijo_no_recup')], + 'minus_report_line_ids': [ref('tax_report_compras_activo_fijo_no_recup')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo_no_recup')], - 'account_id': ref('account_110730'), + 'minus_report_line_ids': [ref('tax_report_compras_iva_activo_fijo_no_recup')], + 'account_id': ref('account_420220'), }), ]"/> </record> <record id="ila_a_100_p" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">Beb. Analcólicas 10% (Compras)</field> + <field name="name">Beb. Analc. 10% (Compras)</field> <field name="description">ILA C 10%</field> <field name="amount">10</field> <field name="amount_type">percent</field> @@ -289,12 +290,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_base_ila_compras')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_compras')], 'account_id': ref('account_420220'), }), ]"/> @@ -302,7 +303,7 @@ <record id="ila_a_180_p" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">Beb. Analcólicas 18% (Compras)</field> + <field name="name">Beb. Analc 18% (Compras)</field> <field name="description">ILA C 18%</field> <field name="amount">18</field> <field name="amount_type">percent</field> @@ -327,12 +328,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_base_ila_compras')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_compras')], 'account_id': ref('account_420220'), }), ]"/> @@ -365,12 +366,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_base_ila_compras')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_compras')], 'account_id': ref('account_420220'), }), ]"/> @@ -403,12 +404,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_base_ila_compras')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_compras')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_compras')], 'account_id': ref('account_420220'), }), ]"/> @@ -416,7 +417,7 @@ <record id="ila_a_100_s" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">Beb. Analcólicas 10% (Ventas)</field> + <field name="name">Beb. Analc. 10% (Ventas)</field> <field name="description">ILA V 10%</field> <field name="amount">10</field> <field name="amount_type">percent</field> @@ -441,12 +442,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_base_ila_ventas')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_ventas')], 'account_id': ref('account_210760'), }), ]"/> @@ -454,7 +455,7 @@ <record id="ila_a_180_s" model="account.tax.template"> <field name="chart_template_id" ref="cl_chart_template"/> - <field name="name">Beb. Analcólicas 18% (Ventas)</field> + <field name="name">Beb. Analc 18% (Ventas)</field> <field name="description">ILA V 18%</field> <field name="amount">18</field> <field name="amount_type">percent</field> @@ -479,12 +480,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_base_ila_ventas')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_ventas')], 'account_id': ref('account_210760'), }), ]"/> @@ -517,12 +518,12 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_base_ila_ventas')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_ventas')], 'account_id': ref('account_210760'), }), ]"/> @@ -555,15 +556,129 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'base', - 'plus_report_line_ids': [ref('tax_report_base_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_base_ila_ventas')], }), (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'plus_report_line_ids': [ref('tax_report_tax_ila_ventas')], + 'minus_report_line_ids': [ref('tax_report_tax_ila_ventas')], 'account_id': ref('account_210760'), }), ]"/> </record> + <record id="iva_compra_no_recup" model="account.tax.template"> + <field name="chart_template_id" ref="cl_chart_template"/> + <field name="name">IVA Compra 19% No Recup.</field> + <field name="description">IVA 19% NoR</field> + <field name="amount">19</field> + <field name="amount_type">percent</field> + <field name="type_tax_use">purchase</field> + <field name="l10n_cl_sii_code">14</field> + <field name="sequence" eval="6"/> + <field name="tax_group_id" ref="tax_group_iva_19"/> + <field name="invoice_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'plus_report_line_ids': [ref('tax_report_compras_netas_gr_iva_no_recuperable')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'plus_report_line_ids': [ref('tax_report_compras_iva_no_recup')], + 'account_id': ref('account_420220'), + }), + ]"/> + <field name="refund_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'minus_report_line_ids': [ref('tax_report_compras_netas_gr_iva_no_recuperable')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'minus_report_line_ids': [ref('tax_report_compras_iva_no_recup')], + 'account_id': ref('account_420220'), + }), + ]"/> + </record> + + <record id="iva_compra_uso_comun" model="account.tax.template"> + <field name="chart_template_id" ref="cl_chart_template"/> + <field name="name">IVA Compra 19% Uso Común</field> + <field name="description">IVA 19% CUC</field> + <field name="amount">19</field> + <field name="amount_type">percent</field> + <field name="type_tax_use">purchase</field> + <field name="l10n_cl_sii_code">14</field> + <field name="sequence" eval="6"/> + <field name="tax_group_id" ref="tax_group_iva_19"/> + <field name="invoice_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'plus_report_line_ids': [ref('tax_report_compras_netas_gr_iva_uso_comun')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'plus_report_line_ids': [ref('tax_report_compras_iva_uso_comun')], + 'account_id': ref('account_110730'), + }), + ]"/> + <field name="refund_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'minus_report_line_ids': [ref('tax_report_compras_netas_gr_iva_uso_comun')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'minus_report_line_ids': [ref('tax_report_compras_iva_uso_comun')], + 'account_id': ref('account_110730'), + }), + ]"/> + </record> + + <record id="iva_supermercado_recup" model="account.tax.template"> + <field name="chart_template_id" ref="cl_chart_template"/> + <field name="name">IVA Compra 19% Superm.</field> + <field name="description">IVA 19% SupMRec</field> + <field name="amount">19</field> + <field name="amount_type">percent</field> + <field name="type_tax_use">purchase</field> + <field name="l10n_cl_sii_code">14</field> + <field name="sequence" eval="6"/> + <field name="tax_group_id" ref="tax_group_iva_19"/> + <field name="invoice_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'plus_report_line_ids': [ref('tax_report_compras_supermercado')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'plus_report_line_ids': [ref('tax_report_compras_iva_supermercado')], + 'account_id': ref('account_110710'), + }), + ]"/> + <field name="refund_repartition_line_ids" eval="[(5, 0, 0), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'minus_report_line_ids': [ref('tax_report_compras_supermercado')], + }), + (0,0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'minus_report_line_ids': [ref('tax_report_compras_iva_supermercado')], + 'account_id': ref('account_110710'), + }), + ]"/> + </record> + </odoo> diff --git a/addons/l10n_cl/data/l10n_cl_chart_data.xml b/addons/l10n_cl/data/l10n_cl_chart_data.xml index cbeba3f8bdb..b602685bdb1 100644 --- a/addons/l10n_cl/data/l10n_cl_chart_data.xml +++ b/addons/l10n_cl/data/l10n_cl_chart_data.xml @@ -348,7 +348,7 @@ <field name="code">110640</field> <field name="name">Existencias en Tránsito</field> <field ref="account.data_account_type_current_assets" name="user_type_id"/> - <field name="reconcile" eval="False"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="cl_chart_template"/> </record> @@ -786,7 +786,7 @@ <field name="code">210230</field> <field name="name">Facturas por Recibir</field> <field ref="account.data_account_type_current_liabilities" name="user_type_id"/> - <field name="reconcile" eval="False"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="cl_chart_template"/> </record> @@ -1547,8 +1547,7 @@ <field name="reconcile" eval="False"/> <field name="chart_template_id" ref="cl_chart_template"/> <field name="tag_ids" - eval="[ - (6,0,[ref('tag_cl_purchase_mnt_neto_uso_comun')])]"/> + eval="[(6,0,[ref('tag_cl_purchase_mnt_neto_uso_comun')])]"/> </record> <record id="account_410232" model="account.account.template"> <field name="code">410232</field> @@ -1575,6 +1574,8 @@ <field ref="account.data_account_type_expenses" name="user_type_id"/> <field name="reconcile" eval="False"/> <field name="chart_template_id" ref="cl_chart_template"/> + <field name="tag_ids" + eval="[(6,0,[ref('tag_cl_purchase_mnt_neto'), ref('tag_cl_purchase_tab_puros'), ref('tag_cl_purchase_tab_cigar')])]"/> </record> <record id="account_410240" model="account.account.template"> @@ -1667,12 +1668,14 @@ <record id="cl_chart_template" model="account.chart.template"> <field name="property_account_receivable_id" ref="account_110310"/> <field name="property_account_payable_id" ref="account_210210"/> - <field name="property_account_expense_categ_id" ref="account_410230"/> + <field name="property_account_expense_categ_id" ref="account_410235"/> <field name="property_account_income_categ_id" ref="account_310115"/> <field name="income_currency_exchange_account_id" ref="account_410195"/> <field name="expense_currency_exchange_account_id" ref="account_410195"/> <field name="default_pos_receivable_account_id" ref="account_110421"/> - <!--<field name="transfer_account_id" ref="transfer_account_id"/>--> + <field name="property_stock_account_input_categ_id" ref="account_210230"/> + <field name="property_stock_account_output_categ_id" ref="account_110640"/> + <field name="property_stock_valuation_account_id" ref="account_110610"/> </record> </odoo> diff --git a/addons/l10n_cl/data/l10n_latam.document.type.csv b/addons/l10n_cl/data/l10n_latam.document.type.csv index 3fdd90b6b30..97119bd79e8 100644 --- a/addons/l10n_cl/data/l10n_latam.document.type.csv +++ b/addons/l10n_cl/data/l10n_latam.document.type.csv @@ -1,11 +1,11 @@ id,sequence,code,name,report_name,internal_type,doc_code_prefix,country_id/id,active -dc_b_f_dte,1,39,Boleta Electrónica,BEL,invoice,BEL,base.cl,True -dc_a_f_dte,2,33,Factura Electrónica,FACTURA,invoice,FAC,base.cl,True -dc_y_f_dte,3,34,Factura no Afecta o Exenta Electrónica,F-EXENTA,invoice,FNA,base.cl,True -dc_m_d_dtn,4,71,Boleta de Honorarios Electrónica,BHE,invoice,BHE,base.cl,True -dc_b_e_dtn,5,38,Boleta exenta,BEX,invoice,BEX,base.cl,False -dc_nc_f_dte,6,61,Nota de Crédito Electrónica,NOTA DE CREDITO,credit_note,N/C,base.cl,True -dc_nd_f_dte,7,56,Nota de Débito Electrónica,NOTA DE DEBITO,debit_note,N/D,base.cl,True +dc_a_f_dte,1,33,Factura Electrónica,FACTURA,invoice,FAC,base.cl,True +dc_y_f_dte,2,34,Factura no Afecta o Exenta Electrónica,F-EXENTA,invoice,FNA,base.cl,True +dc_nc_f_dte,3,61,Nota de Crédito Electrónica,NOTA DE CREDITO,credit_note,N/C,base.cl,True +dc_nd_f_dte,4,56,Nota de Débito Electrónica,NOTA DE DEBITO,debit_note,N/D,base.cl,True +dc_b_f_dte,5,39,Boleta Electrónica,BEL,invoice,BEL,base.cl,True +dc_m_d_dtn,6,71,Boleta de Honorarios Electrónica,BHE,invoice,BHE,base.cl,True +dc_b_e_dtn,7,38,Boleta exenta,BEX,invoice,BEX,base.cl,False dc_I_f_dtn,10,29,Factura de Inicio,FAI,invoice,FAI,base.cl,False dc_a_f_dtn,10,30,Factura,FACTURA,invoice,FAC,base.cl,False dc_y_f_dtn,10,32,Factura de Ventas y Servicios no Afectos o Exentos de IVA,F-EXENTA,invoice,FNA,base.cl,False @@ -35,6 +35,7 @@ dc_li,10,103,Liquidación,LIQ,,LIQ,base.cl,False dc_fe_dte,10,110,Factura de Exportación Electrónica,FCXE,invoice,FCXE,base.cl,False dc_ndex_dte,10,111,Nota de Débito de Exportación Electrónica,NDXE,debit_note,NDXE,base.cl,False dc_ncex_dte,10,112,Nota de Crédito de Exportación Electrónica,NCXE,credit_note,NCXE,base.cl,False +dc_odc,10,801,Orden de Compra,OC,,OC,base.cl,False dc_ndp,10,802,Nota de pedido,NP,,NP,base.cl,False dc_cont,10,803,Contrato,CONT,,CONT,base.cl,False dc_resol,10,804,Resolución,RES,,RES,base.cl,False diff --git a/addons/l10n_cl/data/res_partner.xml b/addons/l10n_cl/data/res_partner.xml index c82f074e1d8..0303c65320c 100644 --- a/addons/l10n_cl/data/res_partner.xml +++ b/addons/l10n_cl/data/res_partner.xml @@ -7,6 +7,7 @@ <field name='l10n_cl_sii_taxpayer_type'>3</field> <field name='l10n_latam_identification_type_id' ref='l10n_cl.it_RUT'/> <field name='vat'>66666666-6</field> + <field name="country_id" ref="base.cl"/> </record> <record model='res.partner' id='par_tgr'> @@ -16,6 +17,7 @@ <field name='l10n_latam_identification_type_id' ref='l10n_cl.it_RUT'/> <field name='vat'>60805000-0</field> <field name="image_1920" type="base64" file="l10n_cl/static/tgr_logo.png"/> + <field name="country_id" ref="base.cl"/> </record> <record model='res.partner' id='par_sii'> @@ -25,6 +27,7 @@ <field name='l10n_latam_identification_type_id' ref='l10n_cl.it_RUT'/> <field name='vat'>60803000-K</field> <field name="image_1920" type="base64" file="l10n_cl/static/sii_logo.jpeg"/> + <field name="country_id" ref="base.cl"/> </record> </data> diff --git a/addons/l10n_cl/i18n/es.po b/addons/l10n_cl/i18n/es.po index a8a8400323b..80c15bba2b4 100644 --- a/addons/l10n_cl/i18n/es.po +++ b/addons/l10n_cl/i18n/es.po @@ -4,16 +4,18 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0alpha1+e\n" +"Project-Id-Version: Odoo Server 13.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-11 18:27+0000\n" -"PO-Revision-Date: 2019-08-11 18:27+0000\n" +"POT-Creation-Date: 2020-06-08 00:58+0000\n" +"PO-Revision-Date: 2020-06-07 21:07-0400\n" "Last-Translator: \n" "Language-Team: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: \n" +"X-Generator: Poedit 2.3.1\n" #. module: l10n_cl #: model:ir.model.fields,help:l10n_cl.field_res_partner__l10n_cl_sii_taxpayer_type @@ -30,6 +32,11 @@ msgstr "" "4 - Extranjero" #. module: l10n_cl +#: model:ir.model,name:l10n_cl.model_account_chart_template +msgid "Account Chart Template" +msgstr "Plantilla de Plan de Cuentas" + +#. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Accounting Date" msgstr "Fecha contable" @@ -38,7 +45,7 @@ msgstr "Fecha contable" #: model:product.product,name:l10n_cl.product_product_ad_valorem #: model:product.template,name:l10n_cl.product_product_ad_valorem_product_template msgid "Ad-Valorem" -msgstr "" +msgstr "Ad-Valorem" #. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree @@ -48,15 +55,15 @@ msgstr "Monto adeudado" #. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Amount Untaxed" -msgstr "Mon sin impuestos" +msgstr "Monto sin impuestos" #. module: l10n_cl #: model:ir.model.fields,help:l10n_cl.field_account_move__l10n_latam_internal_type #: model:ir.model.fields,help:l10n_cl.field_l10n_latam_document_type__internal_type msgid "" "Analog to odoo account.move.type but with more options allowing to 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)" +"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 account.move.type de Odoo pero con más opciones, permitiendo " "identificar el tipo de documento sobre el que estamos trabajando. (no " @@ -66,7 +73,7 @@ msgstr "" #. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_bar msgid "BAR" -msgstr "" +msgstr "BAR" #. module: l10n_cl #: model:ir.model,name:l10n_cl.model_res_bank @@ -76,12 +83,7 @@ msgstr "Banco" #. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_carton msgid "CARTON" -msgstr "" - -#. module: l10n_cl -#: model:l10n_latam.identification.type,name:l10n_cl.it_CIe -msgid "CIe" -msgstr "" +msgstr "CARTON" #. module: l10n_cl #: model:product.product,description:l10n_cl.product_product_ad_valorem @@ -95,6 +97,11 @@ msgid "Chile" msgstr "" #. module: l10n_cl +#: model_terms:ir.ui.view,arch_db:l10n_cl.res_config_settings_view_form +msgid "Chilean Localization" +msgstr "Localización Chilena" + +#. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_res_bank__l10n_cl_sbif_code msgid "Cod. SBIF" msgstr "" @@ -110,26 +117,29 @@ msgid "Companies" msgstr "Compañías" #. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__3 +msgid "Consumidor final" +msgstr "" + +#. module: l10n_cl #: model:ir.model,name:l10n_cl.model_res_partner msgid "Contact" msgstr "Contacto" #. module: l10n_cl #: model:ir.model,name:l10n_cl.model_res_country -#: model:ir.model.fields,field_description:l10n_cl.field_res_partner__country_id -#: model:ir.model.fields,field_description:l10n_cl.field_res_users__country_id msgid "Country" msgstr "País" #. module: l10n_cl -#: selection:l10n_latam.document.type,internal_type:0 -msgid "Credit Notes" -msgstr "Notas de crédito" +#: model_terms:ir.ui.view,arch_db:l10n_cl.view_account_journal_form_inherit_l10n_cl +msgid "Create New Sequences" +msgstr "Crear nuevas secuencias" #. module: l10n_cl -#: model:account.account.type,name:l10n_cl.account_account_type_NCLASIFICADO -msgid "Cuentas No Clasificadas" -msgstr "" +#: model:ir.model.fields.selection,name:l10n_cl.selection__l10n_latam_document_type__internal_type__credit_note +msgid "Credit Notes" +msgstr "Notas de Crédito" #. module: l10n_cl #: model:ir.model,name:l10n_cl.model_res_currency @@ -142,12 +152,16 @@ msgid "Currency Code" msgstr "Código de moneda" #. module: l10n_cl +#: model:ir.model.fields,field_description:l10n_cl.field_res_country__l10n_cl_customs_abbreviation +msgid "Customs Abbreviation" +msgstr "Abreviatura de aduana" + +#. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_res_country__l10n_cl_customs_code msgid "Customs Code" msgstr "Código de aduana" #. module: l10n_cl -#: model:ir.model.fields,field_description:l10n_cl.field_res_country__l10n_cl_customs_abbreviation #: model:ir.model.fields,field_description:l10n_cl.field_res_country__l10n_cl_customs_name msgid "Customs Name" msgstr "Nombre de aduana" @@ -163,9 +177,9 @@ msgid "Datos adic. dirección y Ciudad" msgstr "" #. module: l10n_cl -#: selection:l10n_latam.document.type,internal_type:0 +#: model:ir.model.fields.selection,name:l10n_cl.selection__l10n_latam_document_type__internal_type__debit_note msgid "Debit Notes" -msgstr "Notas de débito" +msgstr "Notas de Débito" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_account_move__l10n_latam_document_type_id_code @@ -173,8 +187,22 @@ msgid "Doc Type" msgstr "Tipo documento" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:18 -#: selection:res.partner,l10n_cl_sii_taxpayer_type:0 +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"Document types for foreign customers must be export type (codes 110, 111 or " +"112)" +msgstr "" +"Los tipos de documento para clientes extranjeros deben ser de exportación. " +"(Códigos 110, 111 o 112)" + +#. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__2 +msgid "Emisor de boleta 2da categoría" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/res_partner.py:0 #, python-format msgid "End Consumer" msgstr "Consumidor final" @@ -185,8 +213,12 @@ msgid "Energía" msgstr "" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:17 -#: selection:res.partner,l10n_cl_sii_taxpayer_type:0 +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__4 +msgid "Extranjero" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/res_partner.py:0 #, python-format msgid "Fees Receipt Issuer (2nd category)" msgstr "Emisor de boleta 2da categoría" @@ -194,11 +226,10 @@ msgstr "Emisor de boleta 2da categoría" #. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Folio" -msgstr "" +msgstr "Folio" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:19 -#: selection:res.partner,l10n_cl_sii_taxpayer_type:0 +#: code:addons/l10n_cl/models/res_partner.py:0 #, python-format msgid "Foreigner" msgstr "Extranjero" @@ -219,9 +250,16 @@ msgid "IVA 19%" msgstr "" #. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__1 +#, fuzzy +#| msgid "VAT Affected (1st Category)" +msgid "IVA afecto 1ª categoría" +msgstr "IVA afecto 1ª categoría" + +#. module: l10n_cl #: model:ir.model.fields,help:l10n_cl.field_account_move__partner_id_vat -msgid "Identification Number for selected type." -msgstr "Número de identificación" +msgid "Identification Number for selected type" +msgstr "Número de Id para el tipo seleccionado" #. module: l10n_cl #: model:account.tax.group,name:l10n_cl.tax_group_impuestos_especificos @@ -229,18 +267,22 @@ msgid "Impuestos Específicos" msgstr "" #. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"In Chilean localization, you need to use documents in the sales journalin " +"order to register your sales properly" +msgstr "" +"Para la localización chilena es necesario usar documentos en los diarios de " +"venta para registrar adecuadamente sus ventas" + +#. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_l10n_latam_document_type__internal_type msgid "Internal Type" msgstr "Tipo interno" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:78 -#, python-format -msgid "Invalid length." -msgstr "Longitud inválida" - -#. module: l10n_cl -#: selection:l10n_latam.document.type,internal_type:0 +#: model:ir.model.fields.selection,name:l10n_cl.selection__l10n_latam_document_type__internal_type__invoice msgid "Invoices" msgstr "Facturas" @@ -260,6 +302,11 @@ msgid "Journal Entries" msgstr "Asientos contables" #. module: l10n_cl +#: model:ir.model.fields,field_description:l10n_cl.field_ir_sequence__l10n_cl_journal_ids +msgid "Journals" +msgstr "Diarios" + +#. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_knfc msgid "KNFC" msgstr "" @@ -272,12 +319,12 @@ msgstr "" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_account_move__l10n_latam_internal_type msgid "L10n Latam Internal Type" -msgstr "" +msgstr "L10n Tipo Interno (Latam)" #. module: l10n_cl #: model:ir.model,name:l10n_cl.model_l10n_latam_document_type msgid "Latam Document Type" -msgstr "" +msgstr "Tipo de Documento Latam" #. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_mm @@ -305,18 +352,6 @@ msgid "Next Number" msgstr "Próximo número" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:109 -#, python-format -msgid "No RUT configured for partner [%i] %s" -msgstr "No se configuró RUT para el cliente o proveedor [%i] %" - -#. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:80 -#, python-format -msgid "Only numbers allowed." -msgstr "Solo se permite números" - -#. module: l10n_cl #: model:uom.category,name:l10n_cl.uom_categ_others msgid "Otros" msgstr "" @@ -327,19 +362,14 @@ msgid "PAR" msgstr "" #. module: l10n_cl -#: model:l10n_latam.identification.type,name:l10n_cl.it_PAS -msgid "PAS" -msgstr "" - -#. module: l10n_cl #: model:ir.model,name:l10n_cl.model_uom_uom msgid "Product Unit of Measure" -msgstr "Unidad de medida" +msgstr "Unidad de medida del producto" #. module: l10n_cl -#: selection:l10n_latam.document.type,internal_type:0 +#: model:ir.model.fields.selection,name:l10n_cl.selection__l10n_latam_document_type__internal_type__invoice_in msgid "Purchase Invoices" -msgstr "Órdenes de compra" +msgstr "Facturas de proveedores" #. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_qmb @@ -359,10 +389,10 @@ msgstr "" #. module: l10n_cl #: model:l10n_latam.identification.type,name:l10n_cl.it_RUT msgid "RUT" -msgstr "" +msgstr "RUT" #. module: l10n_cl -#: selection:l10n_latam.document.type,internal_type:0 +#: model:ir.model.fields.selection,name:l10n_cl.selection__l10n_latam_document_type__internal_type__receipt_invoice msgid "Receipt Invoice" msgstr "" @@ -388,15 +418,21 @@ msgid "S.U.M" msgstr "" #. module: l10n_cl +#: model:ir.model.fields,field_description:l10n_cl.field_account_tax__l10n_cl_sii_code +#: model:ir.model.fields,field_description:l10n_cl.field_account_tax_template__l10n_cl_sii_code #: model:ir.model.fields,field_description:l10n_cl.field_uom_uom__l10n_cl_sii_code msgid "SII Code" -msgstr "" +msgstr "Código SII" #. module: l10n_cl #: model:ir.actions.act_window,name:l10n_cl.sale_invoices_credit_notes +msgid "Sale Invoices and Credit Notes" +msgstr "Facturas de Venta y Notas de Crédito" + +#. module: l10n_cl #: model:ir.ui.menu,name:l10n_cl.menu_sale_invoices_credit_notes -msgid "(CL) Sale Invoices and Credit Notes" -msgstr "(CL) Facturas de venta y notas de crédito" +msgid "Sale Invoices and Credit Notes (CL)" +msgstr "Facturas de Vta y Notas de Crédito (CL)" #. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree @@ -404,14 +440,15 @@ msgid "Sales Person" msgstr "Comercial" #. module: l10n_cl +#: model:ir.model,name:l10n_cl.model_ir_sequence #: model_terms:ir.ui.view,arch_db:l10n_cl.view_account_journal_form_inherit_l10n_cl msgid "Sequence" msgstr "Secuencia" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_account_journal__l10n_cl_sequence_ids -msgid "Sequences" -msgstr "Secuencias" +msgid "Sequences (cl)" +msgstr "Secuencias (CL)" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_res_currency__l10n_cl_short_name @@ -434,26 +471,102 @@ msgid "TMN" msgstr "" #. module: l10n_cl +#: model:ir.model,name:l10n_cl.model_account_tax #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Tax" +msgstr "Impuesto" + +#. module: l10n_cl +#: model_terms:ir.ui.view,arch_db:l10n_cl.view_move_form +msgid "Tax Payer Type" +msgstr "Tipo de Contribuyente" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"Tax payer type and vat number are mandatory for this type of document. " +"Please set the current tax payer type of this customer" +msgstr "" +"El tipo de contribuyente y el número de RUT son requeridos para este tipo de " +"documento. Por favor establezca un valor para el tipo de contribuyente de " +"este Cliente" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"Tax payer type and vat number are mandatory for this type of document. " +"Please set the current tax payer type of this supplier" msgstr "" +"El tipo de contribuyente y el número de RUT son requeridos para este tipo de " +"documento. Por favor establezca un valor para el tipo de contribuyente de " +"este Proveedor" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_res_partner__l10n_cl_sii_taxpayer_type #: model:ir.model.fields,field_description:l10n_cl.field_res_users__l10n_cl_sii_taxpayer_type -msgid "Taxpayer Types" +msgid "Taxpayer Type" +msgstr "Tipo de Contribuyente" + +#. module: l10n_cl +#: model:ir.model,name:l10n_cl.model_account_tax_template +msgid "Templates for Taxes" +msgstr "Plantilla de impuestos" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The DIN document is intended to be used only with RUT 60805000-0 (Tesorería " +"General de La República)" msgstr "" +"El documento “declaración de ingreso” (DIN) debe ser usado solamente para " +"“Tesorería General de La República” (RUT 60805000-0)" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:76 +#: code:addons/l10n_cl/models/account_move.py:0 #, python-format -msgid "The validation digit is not valid." -msgstr "El dígito de validación no es correcto" +msgid "" +"The tax payer type of this supplier is incorrect for the selected type of " +"document." +msgstr "" +"El tipo de contribuyente de este proveedor es incorrecto para el tipo de " +"documento seleccionado." + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The tax payer type of this supplier is not entitled to deliver fees documents" +msgstr "" +"El tipo de contribuyente para este proveedor no puede emitir boletas de " +"honorarios" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The tax payer type of this supplier is not entitled to deliver imports " +"documents" +msgstr "" +"El tipo de contribuyente para este proveedor no puede emitir documentos de " +"importación" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"This supplier should be defined as foreigner tax payer type and the country " +"should be different from Chile to register purchases." +msgstr "" +"Este proveedor debería ser definido como tipo de contribuyente “Extranjero” " +"y el país debería ser diferente de Chile para registrar compras." #. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Total" -msgstr "" +msgstr "Total" #. module: l10n_cl #: model:uom.uom,name:l10n_cl.product_uom_u @@ -461,8 +574,7 @@ msgid "U(JGO)" msgstr "" #. module: l10n_cl -#: code:addons/l10n_cl/models/res_partner.py:16 -#: selection:res.partner,l10n_cl_sii_taxpayer_type:0 +#: code:addons/l10n_cl/models/res_partner.py:0 #, python-format msgid "VAT Affected (1st Category)" msgstr "IVA afecto 1ª categoría" @@ -470,16 +582,22 @@ msgstr "IVA afecto 1ª categoría" #. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_account_move__partner_id_vat msgid "VAT No" -msgstr "" +msgstr "RUT Nº" #. module: l10n_cl #: model:ir.actions.act_window,name:l10n_cl.vendor_bills_and_refunds +msgid "Vendor Bills and Refunds" +msgstr "Facturas y Notas de Créd de Proveedores" + +#. module: l10n_cl #: model:ir.ui.menu,name:l10n_cl.menu_vendor_bills_and_refunds -msgid "(CL) Vendor Bills and Refunds" -msgstr "(CL) Facturas y notas de crédito de proveedores" +msgid "Vendor Bills and Refunds (CL)" +msgstr "Facturas de Proveedor y Notas de Crédito (CL)" #. module: l10n_cl -#: code:addons/l10n_cl/models/account_move.py:54 +#: code:addons/l10n_cl/models/account_move.py:0 #, python-format -msgid "You can not use a %s document type with this tax payer type" -msgstr "No puedes usar un tipo de documento %s con este tipo de contribuyente " +msgid "You need a journal without the use of documents for foreign suppliers" +msgstr "" +"Ud. necesita un diario que no use documentos para registrar facturas de " +"proveedores extranjeros" diff --git a/addons/l10n_cl/i18n/l10n_cl.pot b/addons/l10n_cl/i18n/l10n_cl.pot index 2d101352216..43c90c6079a 100644 --- a/addons/l10n_cl/i18n/l10n_cl.pot +++ b/addons/l10n_cl/i18n/l10n_cl.pot @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 13.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-29 15:06+0000\n" -"PO-Revision-Date: 2020-01-29 15:06+0000\n" +"POT-Creation-Date: 2020-06-08 00:58+0000\n" +"PO-Revision-Date: 2020-06-08 00:58+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -107,6 +107,11 @@ msgid "Companies" msgstr "" #. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__3 +msgid "Consumidor final" +msgstr "" + +#. module: l10n_cl #: model:ir.model,name:l10n_cl.model_res_partner msgid "Contact" msgstr "" @@ -172,8 +177,20 @@ msgid "Doc Type" msgstr "" #. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"Document types for foreign customers must be export type (codes 110, 111 or " +"112)" +msgstr "" + +#. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__2 +msgid "Emisor de boleta 2da categoría" +msgstr "" + +#. module: l10n_cl #: code:addons/l10n_cl/models/res_partner.py:0 -#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__3 #, python-format msgid "End Consumer" msgstr "" @@ -184,8 +201,12 @@ msgid "Energía" msgstr "" #. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__4 +msgid "Extranjero" +msgstr "" + +#. module: l10n_cl #: code:addons/l10n_cl/models/res_partner.py:0 -#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__2 #, python-format msgid "Fees Receipt Issuer (2nd category)" msgstr "" @@ -197,7 +218,6 @@ msgstr "" #. module: l10n_cl #: code:addons/l10n_cl/models/res_partner.py:0 -#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__4 #, python-format msgid "Foreigner" msgstr "" @@ -218,6 +238,11 @@ msgid "IVA 19%" msgstr "" #. module: l10n_cl +#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__1 +msgid "IVA afecto 1ª categoría" +msgstr "" + +#. module: l10n_cl #: model:ir.model.fields,help:l10n_cl.field_account_move__partner_id_vat msgid "Identification Number for selected type" msgstr "" @@ -228,6 +253,14 @@ msgid "Impuestos Específicos" msgstr "" #. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"In Chilean localization, you need to use documents in the sales journalin " +"order to register your sales properly" +msgstr "" + +#. module: l10n_cl #: model:ir.model.fields,field_description:l10n_cl.field_l10n_latam_document_type__internal_type msgid "Internal Type" msgstr "" @@ -436,8 +469,16 @@ msgstr "" #: code:addons/l10n_cl/models/account_move.py:0 #, python-format msgid "" -"Tax payer type is mandatory for this type of document. Please set the " -"current tax payer type of this client" +"Tax payer type and vat number are mandatory for this type of document. " +"Please set the current tax payer type of this customer" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"Tax payer type and vat number are mandatory for this type of document. " +"Please set the current tax payer type of this supplier" msgstr "" #. module: l10n_cl @@ -452,6 +493,46 @@ msgid "Templates for Taxes" msgstr "" #. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The DIN document is intended to be used only with RUT 60805000-0 (Tesorería " +"General de La República)" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The tax payer type of this supplier is incorrect for the selected type of " +"document." +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The tax payer type of this supplier is not entitled to deliver fees " +"documents" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"The tax payer type of this supplier is not entitled to deliver imports " +"documents" +msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "" +"This supplier should be defined as foreigner tax payer type and the country " +"should be different from Chile to register purchases." +msgstr "" + +#. module: l10n_cl #: model_terms:ir.ui.view,arch_db:l10n_cl.view_complete_invoice_refund_tree msgid "Total" msgstr "" @@ -463,7 +544,6 @@ msgstr "" #. module: l10n_cl #: code:addons/l10n_cl/models/res_partner.py:0 -#: model:ir.model.fields.selection,name:l10n_cl.selection__res_partner__l10n_cl_sii_taxpayer_type__1 #, python-format msgid "VAT Affected (1st Category)" msgstr "" @@ -482,3 +562,9 @@ msgstr "" #: model:ir.ui.menu,name:l10n_cl.menu_vendor_bills_and_refunds msgid "Vendor Bills and Refunds (CL)" msgstr "" + +#. module: l10n_cl +#: code:addons/l10n_cl/models/account_move.py:0 +#, python-format +msgid "You need a journal without the use of documents for foreign suppliers" +msgstr "" diff --git a/addons/l10n_cl/models/account_journal.py b/addons/l10n_cl/models/account_journal.py index ce218d0a827..5d3fca43818 100644 --- a/addons/l10n_cl/models/account_journal.py +++ b/addons/l10n_cl/models/account_journal.py @@ -13,7 +13,11 @@ class AccountJournal(models.Model): def button_create_new_sequences(self): self.ensure_one() internal_types = ['invoice', 'debit_note', 'credit_note'] - domain = [('country_id.code', '=', 'CL'), ('internal_type', 'in', internal_types), ('active', '=', True)] + domain = [('country_id.code', '=', 'CL'), ('internal_type', 'in', internal_types)] + if self.company_id.partner_id.l10n_cl_sii_taxpayer_type in ['1', False]: + domain += [('code', 'not in', ['70', '71'])] + elif self.company_id.partner_id.l10n_cl_sii_taxpayer_type == '2': + domain += [('code', 'not in', ['33', '34'])] documents = self.env['l10n_latam.document.type'].search(domain) sequences = self.env['ir.sequence'] for document in documents: diff --git a/addons/l10n_cl/models/account_move.py b/addons/l10n_cl/models/account_move.py index 7adb1a73d26..249e155fca7 100644 --- a/addons/l10n_cl/models/account_move.py +++ b/addons/l10n_cl/models/account_move.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.exceptions import ValidationError - from odoo import models, fields, api, _ @@ -18,26 +17,80 @@ class AccountMove(models.Model): domain = super()._get_l10n_latam_documents_domain() if (self.journal_id.l10n_latam_use_documents and self.journal_id.company_id.country_id == self.env.ref('base.cl')): - if self.move_type in ['in_invoice', 'in_refund']: - if self.partner_id.l10n_cl_sii_taxpayer_type == '2': - domain += [('code', '=', '71')] - return domain - document_type_ids = self.journal_id.l10n_cl_sequence_ids.mapped('l10n_latam_document_type_id').ids - domain += [('id', 'in', document_type_ids)] - if self.partner_id.l10n_cl_sii_taxpayer_type == '3': - domain += [('code', 'in', ['35', '38', '39', '41', '56', '61'])] + if self.journal_id.type == 'sale': + document_type_ids = self.journal_id.l10n_cl_sequence_ids.mapped('l10n_latam_document_type_id').ids + else: # self.journal_id.type == 'purchase': + partner_domain = [ + ('country_id.code', '=', 'CL'), + ('internal_type', 'in', ['invoice', 'debit_note', 'credit_note', 'invoice_in'])] + if not self.partner_id: + pass + elif self.partner_id.l10n_cl_sii_taxpayer_type == '1' and self.partner_id_vat != '60805000-0': + partner_domain += [('code', 'not in', ['39', '70', '71', '914', '911'])] + elif self.partner_id.l10n_cl_sii_taxpayer_type == '1' and self.partner_id_vat == '60805000-0': + partner_domain += [('code', 'not in', ['39', '70', '71'])] + elif self.partner_id.l10n_cl_sii_taxpayer_type == '2': + partner_domain += [('code', 'in', ['70', '71', '56', '61'])] + elif self.partner_id.l10n_cl_sii_taxpayer_type == '3': + partner_domain += [('code', 'in', ['35', '38', '39', '41', '56', '61'])] + elif not self.partner_id.l10n_cl_sii_taxpayer_type or self.partner_id.country_id != self.env.ref( + 'base.cl') or self.partner_id.l10n_cl_sii_taxpayer_type == '4': + partner_domain += [('code', 'in', [])] + document_type_ids = self.env['l10n_latam.document.type'].search(partner_domain).ids + domain = [('id', 'in', document_type_ids)] return domain - @api.constrains('move_type', 'l10n_latam_document_type_id') - def _check_invoice_type_document_type(self): - super()._check_invoice_type_document_type() - for rec in self.filtered(lambda r: r.company_id.country_id == self.env.ref( - 'base.cl') and r.l10n_latam_document_type_id): + def _check_document_types_post(self): + for rec in self.filtered( + lambda r: r.company_id.country_id == self.env.ref('base.cl') and + r.journal_id.type in ['sale', 'purchase']): tax_payer_type = rec.partner_id.l10n_cl_sii_taxpayer_type + vat = rec.partner_id.vat + country_id = rec.partner_id.country_id latam_document_type_code = rec.l10n_latam_document_type_id.code - if not tax_payer_type and latam_document_type_code not in ['35', '38', '39', '41']: - raise ValidationError(_('Tax payer type is mandatory for this type of document. ' - 'Please set the current tax payer type of this client')) + if (not tax_payer_type or not vat) and (country_id == self.env.ref('base.cl') and latam_document_type_code + and latam_document_type_code not in ['35', '38', '39', '41']): + raise ValidationError(_('Tax payer type and vat number are mandatory for this type of ' + 'document. Please set the current tax payer type of this customer')) + if rec.journal_id.type == 'sale' and rec.journal_id.l10n_latam_use_documents: + if (tax_payer_type == '4' or country_id != self.env.ref('base.cl')) and \ + latam_document_type_code not in ['110', '111', '112']: + raise ValidationError(_( + 'Document types for foreign customers must be export type (codes 110, 111 or 112)')) + if rec.journal_id.type == 'purchase' and rec.journal_id.l10n_latam_use_documents: + if vat != '60805000-0' and latam_document_type_code == '914': + raise ValidationError(_('The DIN document is intended to be used only with RUT 60805000-0' + ' (Tesorería General de La República)')) + if not tax_payer_type or not vat: + if country_id == self.env.ref('base.cl') and latam_document_type_code not in [ + '35', '38', '39', '41']: + raise ValidationError(_('Tax payer type and vat number are mandatory for this type of ' + 'document. Please set the current tax payer type of this supplier')) + if tax_payer_type == '2' and latam_document_type_code not in ['70', '71', '56', '61']: + raise ValidationError(_('The tax payer type of this supplier is incorrect for the selected type' + ' of document.')) + if tax_payer_type in ['1', '3']: + if latam_document_type_code in ['70', '71']: + raise ValidationError(_('The tax payer type of this supplier is not entitled to deliver ' + 'fees documents')) + if latam_document_type_code in ['110', '111', '112']: + raise ValidationError(_('The tax payer type of this supplier is not entitled to deliver ' + 'imports documents')) + if tax_payer_type == '4' or country_id != self.env.ref('base.cl'): + raise ValidationError(_('You need a journal without the use of documents for foreign ' + 'suppliers')) + if rec.journal_id.type == 'purchase' and not rec.journal_id.l10n_latam_use_documents: + if tax_payer_type != '4': + raise ValidationError(_('This supplier should be defined as foreigner tax payer type and ' + 'the country should be different from Chile to register purchases.')) + + @api.onchange('journal_id') + def _onchange_journal(self): + self.l10n_latam_document_type_id = False + + def post(self): + self._check_document_types_post() + super().post() def _l10n_cl_get_formatted_sequence(self, number=0): return "%s %06d" % (self.l10n_latam_document_type_id.doc_code_prefix, number) diff --git a/addons/l10n_cl/models/account_tax.py b/addons/l10n_cl/models/account_tax.py index c1edd934a50..0f102863763 100644 --- a/addons/l10n_cl/models/account_tax.py +++ b/addons/l10n_cl/models/account_tax.py @@ -7,7 +7,7 @@ class AccountTax(models.Model): _name = 'account.tax' _inherit = 'account.tax' - l10n_cl_sii_code = fields.Integer('SII Code') + l10n_cl_sii_code = fields.Integer('SII Code', group_operator=False) class AccountTaxTemplate(models.Model): diff --git a/addons/l10n_cl/models/res_partner.py b/addons/l10n_cl/models/res_partner.py index 608f031ae6c..463051628f9 100644 --- a/addons/l10n_cl/models/res_partner.py +++ b/addons/l10n_cl/models/res_partner.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +import stdnum from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError @@ -21,3 +22,34 @@ class ResPartner(models.Model): '2 - Fees Receipt Issuer (Applies to suppliers who issue fees receipt)\n' '3 - End consumer (only receipts)\n' '4 - Foreigner') + + def _format_vat_cl(self, values): + identification_types = [self.env.ref('l10n_latam_base.it_vat').id, self.env.ref('l10n_cl.it_RUT').id, + self.env.ref('l10n_cl.it_RUN').id] + partner_country_is_chile = (values.get('country_id') == self.env.ref('base.cl').id) or ( + values.get('l10n_latam_identification_type_id') and + self.env['l10n_latam.identification.type'].browse( + values.get('l10n_latam_identification_type_id')).country_id == self.env.ref('base.cl')) + if partner_country_is_chile and \ + values.get('l10n_latam_identification_type_id') in identification_types and values.get('vat'): + return stdnum.util.get_cc_module('cl', 'vat').format(values['vat']).replace('.', '').replace( + 'CL', '').upper() + else: + return values['vat'] + + @api.model + def create(self, values): + if values.get('vat'): + values['vat'] = self._format_vat_cl(values) + return super().create(values) + + def write(self, values): + for record in self: + vat_values = { + 'vat': values.get('vat', record.vat), + 'l10n_latam_identification_type_id': values.get( + 'l10n_latam_identification_type_id', record.l10n_latam_identification_type_id.id), + 'country_id': values.get('country_id', record.country_id.id) + } + values['vat'] = self._format_vat_cl(vat_values) + return super().write(values) |
