summaryrefslogtreecommitdiff
path: root/addons/l10n_mx/models
diff options
context:
space:
mode:
authorBenjamin Frantzen (bfr) <bfr@odoo.com>2020-08-06 08:51:04 +0000
committerLaurent Smet <las@odoo.com>2020-08-17 10:22:02 +0000
commite2c6a37d3207e59c631e8b4686ff9de0f6de9a66 (patch)
tree6b5d1158abce5aa155538469e5445632060811a0 /addons/l10n_mx/models
parent013936261b26c601ce55015dbbbb99a7313a9a39 (diff)
[REF] l10n_mx_edi: Refactoring of l10n_mx_edi depending account_edi
closes odoo/odoo#52407 Task: 2247368 Related: odoo/enterprise#12226 Related: odoo/upgrade#1571 Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/l10n_mx/models')
-rw-r--r--addons/l10n_mx/models/__init__.py1
-rw-r--r--addons/l10n_mx/models/account_tax.py38
2 files changed, 39 insertions, 0 deletions
diff --git a/addons/l10n_mx/models/__init__.py b/addons/l10n_mx/models/__init__.py
index e92febf4135..81b9491a806 100644
--- a/addons/l10n_mx/models/__init__.py
+++ b/addons/l10n_mx/models/__init__.py
@@ -3,6 +3,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import account
+from . import account_tax
from . import res_bank
from . import res_config_settings
from . import chart_template
diff --git a/addons/l10n_mx/models/account_tax.py b/addons/l10n_mx/models/account_tax.py
new file mode 100644
index 00000000000..a435a9ea25a
--- /dev/null
+++ b/addons/l10n_mx/models/account_tax.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+from odoo import models, fields
+
+
+class AccountTaxTemplate(models.Model):
+ _inherit = 'account.tax.template'
+
+ l10n_mx_tax_type = fields.Selection(
+ selection=[
+ ('Tasa', "Tasa"),
+ ('Cuota', "Cuota"),
+ ('Exento', "Exento"),
+ ],
+ string="Factor Type",
+ 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.")
+
+ def _get_tax_vals(self, company, tax_template_to_tax):
+ # OVERRIDE
+ res = super()._get_tax_vals(company, tax_template_to_tax)
+ res['l10n_mx_tax_type'] = self.l10n_mx_tax_type
+ return res
+
+
+class AccountTax(models.Model):
+ _inherit = 'account.tax'
+
+ l10n_mx_tax_type = fields.Selection(
+ selection=[
+ ('Tasa', "Tasa"),
+ ('Cuota', "Cuota"),
+ ('Exento', "Exento"),
+ ],
+ string="Factor Type",
+ 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.")