From cdd29dfe98003270124110e6bbf13b64618e1f1f Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Thu, 7 Sep 2023 17:04:09 +0200 Subject: [PATCH] [IMP] l10n_mx: add `l10n_mx_tax_type` on tax Add a selection field `l10n_mx_tax_type` on account.tax. This field is used in the CFDI attachment. This allows to avoid relying on the name of the repartition line tags to export and import a CFDI. task-3388347 closes odoo/odoo#135215 Related: odoo/enterprise#47321 Related: odoo/upgrade#5136 Signed-off-by: Laurent Smet (las) --- addons/account/models/product.py | 4 +- addons/l10n_mx/__manifest__.py | 1 + .../l10n_mx/data/template/account.tax-mx.csv | 186 +++++++++--------- addons/l10n_mx/models/account_tax.py | 20 +- addons/l10n_mx/views/account_tax_view.xml | 13 ++ 5 files changed, 128 insertions(+), 96 deletions(-) create mode 100644 addons/l10n_mx/views/account_tax_view.xml diff --git a/addons/account/models/product.py b/addons/account/models/product.py index c91679f90ff..faf9e35437f 100644 --- a/addons/account/models/product.py +++ b/addons/account/models/product.py @@ -210,13 +210,14 @@ class ProductProduct(models.Model): # EDI # ------------------------------------------------------------------------- - def _retrieve_product(self, name=None, default_code=None, barcode=None, company=None): + def _retrieve_product(self, name=None, default_code=None, barcode=None, company=None, extra_domain=None): '''Search all products and find one that matches one of the parameters. :param name: The name of the product. :param default_code: The default_code of the product. :param barcode: The barcode of the product. :param company: The company of the product. + :param extra_domain: Any extra domain to add to the search. :returns: A product or an empty recordset if not found. ''' if name and '\n' in name: @@ -234,5 +235,6 @@ class ProductProduct(models.Model): domain = expression.AND([ expression.OR(domains), self.env['product.product']._check_company_domain(company), + extra_domain, ]) return self.env['product.product'].search(domain, limit=1) diff --git a/addons/l10n_mx/__manifest__.py b/addons/l10n_mx/__manifest__.py index eac37eb5ee0..2878d2a65ba 100644 --- a/addons/l10n_mx/__manifest__.py +++ b/addons/l10n_mx/__manifest__.py @@ -37,6 +37,7 @@ With this module you will have: 'views/res_bank_view.xml', 'views/res_config_settings_views.xml', 'views/account_views.xml', + 'views/account_tax_view.xml', "data/l10n_mx_uom.xml", ], 'demo': [ diff --git a/addons/l10n_mx/data/template/account.tax-mx.csv b/addons/l10n_mx/data/template/account.tax-mx.csv index e75081fb343..ad9c00efcb3 100644 --- a/addons/l10n_mx/data/template/account.tax-mx.csv +++ b/addons/l10n_mx/data/template/account.tax-mx.csv @@ -1,93 +1,93 @@ -"id","sequence","name","description","invoice_label","amount","amount_type","type_tax_use","tax_group_id","tax_exigibility","cash_basis_transition_account_id","l10n_mx_tax_type","active","repartition_line_ids/repartition_type","repartition_line_ids/document_type","repartition_line_ids/account_id","repartition_line_ids/tag_ids","description@es","invoice_label@es" -"ieps_8_sale","0","8% IEPS","","IEPS 8%","8.0","percent","sale","tax_group_ieps_8","on_payment","cuenta209_02","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" -"ieps_8_purchase","1","8% IEPS","","IEPS 8%","8.0","percent","purchase","tax_group_ieps_8","on_payment","cuenta119_03","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" -"ieps_25_sale","2","25% IEPS","","IEPS 25%","25.0","percent","sale","tax_group_ieps_25","on_payment","cuenta209_02","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" -"ieps_25_purchase","3","25% IEPS","","IEPS 25%","25.0","percent","purchase","tax_group_ieps_25","on_payment","cuenta119_03","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" -"ieps_26_5_sale","4","26.5% IEPS","","IEPS 26.5%","26.5","percent","sale","tax_group_ieps_26_5","on_payment","cuenta209_02","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" -"ieps_26_5_purchase","5","26.5% IEPS","","IEPS 26.5%","26.5","percent","purchase","tax_group_ieps_26_5","on_payment","cuenta119_03","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" -"ieps_30_sale","6","30% IEPS","","IEPS 30%","30.0","percent","sale","tax_group_ieps_30","on_payment","cuenta209_02","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" -"ieps_30_purchase","7","30% IEPS","","IEPS 30%","30.0","percent","purchase","tax_group_ieps_30","on_payment","cuenta119_03","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" -"ieps_53_sale","8","53% IEPS","","IEPS 53%","53.0","percent","sale","tax_group_ieps_53","on_payment","cuenta209_02","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" -"ieps_53_purchase","9","53% IEPS","","IEPS 53%","53.0","percent","purchase","tax_group_ieps_53","on_payment","cuenta119_03","","","base","invoice","","","" -"","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" -"","","","","","","","","","","","","","base","refund","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" -"tax9","10","0%","","VAT(0%)","0.0","percent","sale","tax_group_iva_0","on_payment","cuenta209_01","Tasa","","base","invoice","","","IVA(0%)","IVA(0%)" -"","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" -"tax12","11","16%","","VAT(16%)","16.0","percent","sale","tax_group_iva_16","on_payment","cuenta209_01","Tasa","","base","invoice","","","IVA(16%)","IVA(16%)" -"","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" -"tax1","12","4% WH","VAT withholding","VAT withholding(-4%)","-4.0","percent","purchase","tax_group_iva_ret_4","on_payment","cuenta216_10","Tasa","","base","invoice","","","Retención del IVA","Retención IVA(-4%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" -"tax18","13","1.25% WH","VAT witholding RESICO 1.25%","Retención IVA(-1.25%)","-1.25","percent","purchase","tax_group_iva_ret_1_25","on_payment","cuenta216_10","Tasa","0","base","invoice","","","Retención de IVA RESICO 1.25%","Retención IVA(-1.25%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" -"tax2","14","10% WH L","VAT withholding lease 10%","VAT withholding(-10%)","-10.0","percent","purchase","tax_group_iva_ret_10","on_payment","cuenta216_10","Tasa","","base","invoice","","","Retención IVA arrendamiento 10%","Retención IVA(-10%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" -"tax3","15","10% WH L I","Withholding of lease income tax 10%","Withholding income(-10%)","-10.0","percent","purchase","tax_group_isr_ret_10","","","Tasa","","base","invoice","","","Retención del impuesto de arrendamiento 10%","Retención ISR(-10%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_03","","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_03","","","" -"tax5","16","10% WH I S","Withholding of income tax on salaries 10%","Withholding income salaries (-10%)","-10.0","percent","purchase","tax_group_isr_ret_10","","","Tasa","","base","invoice","","","Retención del impuesto sobre la renta sobre los salarios 10%","Retención ISR(-10%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_04","","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_04","","","" -"tax7","17","10.67% WH L","Vat withholding tax on leasing 10.67%","Vat withholding(-10.67%)","-10.67","percent","purchase","tax_group_iva_ret_1067","on_payment","cuenta216_10","Tasa","","base","invoice","","","Retención a cuenta del IVA sobre el arrendamiento financiero 10.67%","Retención IVA(-10.67%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" -"tax8","18","10.67% WH","Vat withholding fees 10.67%","Vat withholding(-10.67%)","-10.67","percent","purchase","tax_group_iva_ret_1067","on_payment","cuenta216_10","Tasa","","base","invoice","","","Retención del IVA 10.67%","Retención IVA(-10.67%)" -"","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" -"tax13","19","0%","","VAT(0%)","0.0","percent","purchase","tax_group_iva_0","on_payment","cuenta119_01","Tasa","","base","invoice","","+DIOT: 0%","","IVA(0%)" -"","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" -"tax14","20","16%","","VAT(16%)","16.0","percent","purchase","tax_group_iva_16","on_payment","cuenta119_01","Tasa","","base","invoice","","+DIOT: 16%","IVA(16%) compras","IVA(16%)" -"","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" -"tax16","21","8%","","VAT(8%)","8.0","percent","purchase","tax_group_iva_8","on_payment","cuenta119_01","Tasa","","base","invoice","","+DIOT: 8%","IVA(8%) compras","IVA(8%)" -"","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" -"tax17","22","8%","","VAT(8%)","8.0","percent","sale","tax_group_iva_8","on_payment","cuenta209_01","Tasa","","base","invoice","","","IVA(8%) ventas","IVA(8%)" -"","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" -"","","","","","","","","","","","","","base","refund","","","","" -"","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" +"id","sequence","name","description","invoice_label","amount","amount_type","type_tax_use","tax_group_id","tax_exigibility","cash_basis_transition_account_id","l10n_mx_tax_type","l10n_mx_factor_type","active","repartition_line_ids/repartition_type","repartition_line_ids/document_type","repartition_line_ids/account_id","repartition_line_ids/tag_ids","description@es","invoice_label@es" +"ieps_8_sale","0","8% IEPS","","IEPS 8%","8.0","percent","sale","tax_group_ieps_8","on_payment","cuenta209_02","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" +"ieps_8_purchase","1","8% IEPS","","IEPS 8%","8.0","percent","purchase","tax_group_ieps_8","on_payment","cuenta119_03","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" +"ieps_25_sale","2","25% IEPS","","IEPS 25%","25.0","percent","sale","tax_group_ieps_25","on_payment","cuenta209_02","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" +"ieps_25_purchase","3","25% IEPS","","IEPS 25%","25.0","percent","purchase","tax_group_ieps_25","on_payment","cuenta119_03","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" +"ieps_26_5_sale","4","26.5% IEPS","","IEPS 26.5%","26.5","percent","sale","tax_group_ieps_26_5","on_payment","cuenta209_02","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" +"ieps_26_5_purchase","5","26.5% IEPS","","IEPS 26.5%","26.5","percent","purchase","tax_group_ieps_26_5","on_payment","cuenta119_03","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" +"ieps_30_sale","6","30% IEPS","","IEPS 30%","30.0","percent","sale","tax_group_ieps_30","on_payment","cuenta209_02","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" +"ieps_30_purchase","7","30% IEPS","","IEPS 30%","30.0","percent","purchase","tax_group_ieps_30","on_payment","cuenta119_03","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" +"ieps_53_sale","8","53% IEPS","","IEPS 53%","53.0","percent","sale","tax_group_ieps_53","on_payment","cuenta209_02","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_02","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_02","l10n_mx.tag_ieps","" +"ieps_53_purchase","9","53% IEPS","","IEPS 53%","53.0","percent","purchase","tax_group_ieps_53","on_payment","cuenta119_03","ieps","","","base","invoice","","","" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_03","l10n_mx.tag_ieps","" +"","","","","","","","","","","","","","","base","refund","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_03","l10n_mx.tag_ieps","" +"tax9","10","0%","","VAT(0%)","0.0","percent","sale","tax_group_iva_0","on_payment","cuenta209_01","iva","Tasa","","base","invoice","","","IVA(0%)","IVA(0%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" +"tax12","11","16%","","VAT(16%)","16.0","percent","sale","tax_group_iva_16","on_payment","cuenta209_01","iva","Tasa","","base","invoice","","","IVA(16%)","IVA(16%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" +"tax1","12","4% WH","VAT withholding","VAT withholding(-4%)","-4.0","percent","purchase","tax_group_iva_ret_4","on_payment","cuenta216_10","iva","Tasa","","base","invoice","","","Retención del IVA","Retención IVA(-4%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" +"tax18","13","1.25% WH","VAT witholding RESICO 1.25%","Retención IVA(-1.25%)","-1.25","percent","purchase","tax_group_iva_ret_1_25","on_payment","cuenta216_10","iva","Tasa","0","base","invoice","","","Retención de IVA RESICO 1.25%","Retención IVA(-1.25%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" +"tax2","14","10% WH L","VAT withholding lease 10%","VAT withholding(-10%)","-10.0","percent","purchase","tax_group_iva_ret_10","on_payment","cuenta216_10","iva","Tasa","","base","invoice","","","Retención IVA arrendamiento 10%","Retención IVA(-10%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" +"tax3","15","10% WH L I","Withholding of lease income tax 10%","Withholding income(-10%)","-10.0","percent","purchase","tax_group_isr_ret_10","","","isr","Tasa","","base","invoice","","","Retención del impuesto de arrendamiento 10%","Retención ISR(-10%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_03","","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_03","","","" +"tax5","16","10% WH I S","Withholding of income tax on salaries 10%","Withholding income salaries (-10%)","-10.0","percent","purchase","tax_group_isr_ret_10","","","isr","Tasa","","base","invoice","","","Retención del impuesto sobre la renta sobre los salarios 10%","Retención ISR(-10%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_04","","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_04","","","" +"tax7","17","10.67% WH L","Vat withholding tax on leasing 10.67%","Vat withholding(-10.67%)","-10.67","percent","purchase","tax_group_iva_ret_1067","on_payment","cuenta216_10","iva","Tasa","","base","invoice","","","Retención a cuenta del IVA sobre el arrendamiento financiero 10.67%","Retención IVA(-10.67%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" +"tax8","18","10.67% WH","Vat withholding fees 10.67%","Vat withholding(-10.67%)","-10.67","percent","purchase","tax_group_iva_ret_1067","on_payment","cuenta216_10","iva","Tasa","","base","invoice","","","Retención del IVA 10.67%","Retención IVA(-10.67%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta216_10_20","-DIOT: Retención","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta216_10_20","+DIOT: Retención","","" +"tax13","19","0%","","VAT(0%)","0.0","percent","purchase","tax_group_iva_0","on_payment","cuenta119_01","iva","Tasa","","base","invoice","","+DIOT: 0%","","IVA(0%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" +"tax14","20","16%","","VAT(16%)","16.0","percent","purchase","tax_group_iva_16","on_payment","cuenta119_01","iva","Tasa","","base","invoice","","+DIOT: 16%","IVA(16%) compras","IVA(16%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" +"tax16","21","8%","","VAT(8%)","8.0","percent","purchase","tax_group_iva_8","on_payment","cuenta119_01","iva","Tasa","","base","invoice","","+DIOT: 8%","IVA(8%) compras","IVA(8%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta118_01","","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta118_01","+DIOT: Refunds","","" +"tax17","22","8%","","VAT(8%)","8.0","percent","sale","tax_group_iva_8","on_payment","cuenta209_01","iva","Tasa","","base","invoice","","","IVA(8%) ventas","IVA(8%)" +"","","","","","","","","","","","","","","tax","invoice","cuenta208_01","l10n_mx.tag_iva","","" +"","","","","","","","","","","","","","","base","refund","","","","" +"","","","","","","","","","","","","","","tax","refund","cuenta208_01","l10n_mx.tag_iva","","" diff --git a/addons/l10n_mx/models/account_tax.py b/addons/l10n_mx/models/account_tax.py index 0ba98c2016a..4da0c6ee23b 100644 --- a/addons/l10n_mx/models/account_tax.py +++ b/addons/l10n_mx/models/account_tax.py @@ -1,11 +1,11 @@ # coding: utf-8 -from odoo import models, fields +from odoo import models, fields, api class AccountTax(models.Model): _inherit = 'account.tax' - l10n_mx_tax_type = fields.Selection( + l10n_mx_factor_type = fields.Selection( selection=[ ('Tasa', "Tasa"), ('Cuota', "Cuota"), @@ -15,3 +15,19 @@ class AccountTax(models.Model): default='Tasa', help="The CFDI version 3.3 have the attribute 'TipoFactor' in the tax lines. In it is indicated the factor " "type that is applied to the base of the tax.") + l10n_mx_tax_type = fields.Selection( + selection=[ + ('isr', "ISR"), + ('iva', "IVA"), + ('ieps', "IEPS"), + ], + string="SAT Tax Type", + compute="_compute_l10n_mx_tax_type", + store=True, + readonly=False, + ) + + @api.depends("country_id") + def _compute_l10n_mx_tax_type(self): + for tax in self: + tax.l10n_mx_tax_type = 'iva' if tax.country_id.code == 'MX' else False diff --git a/addons/l10n_mx/views/account_tax_view.xml b/addons/l10n_mx/views/account_tax_view.xml new file mode 100644 index 00000000000..98f598d7b82 --- /dev/null +++ b/addons/l10n_mx/views/account_tax_view.xml @@ -0,0 +1,13 @@ + + + + account.tax.form.inherit.l10n_mx + account.tax + + + + + + + +