From 014d9fcea4738210e44c6d36cc665a4c8f60c988 Mon Sep 17 00:00:00 2001 From: Arturo Flores Date: Tue, 19 May 2020 08:17:43 +0000 Subject: [DEL] l10n_pe: delete rounding method and let round per line be as default closes odoo/odoo#52320 X-original-commit: ef84278ea131af2f283750c95cd389a2af1570af Signed-off-by: Josse Colpaert --- addons/l10n_pe/models/__init__.py | 2 -- addons/l10n_pe/models/account_chart_template.py | 14 -------------- addons/l10n_pe/models/res_company.py | 13 ------------- 3 files changed, 29 deletions(-) delete mode 100644 addons/l10n_pe/models/account_chart_template.py delete mode 100644 addons/l10n_pe/models/res_company.py (limited to 'addons/l10n_pe') diff --git a/addons/l10n_pe/models/__init__.py b/addons/l10n_pe/models/__init__.py index 2037a75eaa2..7be3012e1aa 100644 --- a/addons/l10n_pe/models/__init__.py +++ b/addons/l10n_pe/models/__init__.py @@ -1,9 +1,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import account_tax from . import account_move -from . import account_chart_template from . import l10n_latam_identification_type from . import res_partner from . import res_city_district from . import res_city -from . import res_company diff --git a/addons/l10n_pe/models/account_chart_template.py b/addons/l10n_pe/models/account_chart_template.py deleted file mode 100644 index e9314da7709..00000000000 --- a/addons/l10n_pe/models/account_chart_template.py +++ /dev/null @@ -1,14 +0,0 @@ -from odoo import models - - -class AccountChartTemplate(models.Model): - - _inherit = 'account.chart.template' - - def _load(self, sale_tax_rate, purchase_tax_rate, company): - """Load the rounding method properly to the company once the CoA is installed. - """ - company.filtered(lambda c: c.country_id.id == self.env.ref('base.pe').id).write({ - 'tax_calculation_rounding_method': 'round_globally', - }) - return super()._load(sale_tax_rate, purchase_tax_rate, company) diff --git a/addons/l10n_pe/models/res_company.py b/addons/l10n_pe/models/res_company.py deleted file mode 100644 index bee9be55580..00000000000 --- a/addons/l10n_pe/models/res_company.py +++ /dev/null @@ -1,13 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import models, api - - -class ResCompany(models.Model): - - _inherit = "res.company" - - @api.onchange('country_id') - def onchange_country(self): - """In Peru, the rounding method it's calculated as global""" - for rec in self.filtered(lambda x: x.country_id == self.env.ref('base.pe')): - rec.tax_calculation_rounding_method = 'round_globally' -- cgit v1.2.3