diff --git a/account_chart_update/tests/test_account_chart_update.py b/account_chart_update/tests/test_account_chart_update.py index e3b2d0268..bfdfec4cb 100644 --- a/account_chart_update/tests/test_account_chart_update.py +++ b/account_chart_update/tests/test_account_chart_update.py @@ -3,6 +3,7 @@ from odoo import fields from odoo.tests import common +from odoo.tools import mute_logger class TestAccountChartUpdate(common.HttpCase): @@ -126,6 +127,7 @@ class TestAccountChartUpdate(common.HttpCase): 'lang': 'en_US' } + @mute_logger('odoo.sql_db') def test_chart_update(self): # Test no changes wizard = self.wizard_obj.create(self.wizard_vals) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 643446363..8457748e2 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -15,7 +15,7 @@ from io import StringIO import logging _logger = logging.getLogger(__name__) -EXCEPTION_TEXT = u"Traceback (most recent call last)" +EXCEPTION_TEXT = "Traceback (most recent call last)" class WizardUpdateChartsAccounts(models.TransientModel): @@ -286,7 +286,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): def find_account_by_templates(self, templates): """Find an account that matches the template.""" return self.env['account.account'].search( - [('code', 'in', map(self.padded_code, templates.mapped("code"))), + [('code', 'in', + list(map(self.padded_code, templates.mapped("code")))), ('company_id', '=', self.company_id.id)], ).id @@ -387,7 +388,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): """ result = dict() ignore = self.fields_to_ignore(template, template._name) - for key, field in template._fields.iteritems(): + for key, field in template._fields.items(): if key in ignore: continue expected = t = None @@ -444,7 +445,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): result = list() different_fields = sorted( template._fields[f].get_description(self.env)["string"] - for f in list(self.diff_fields(template, real).keys())) + for f in self.diff_fields(template, real).keys()) if different_fields: result.append( _("Differences in these fields: %s.") % @@ -580,7 +581,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): _logger.info(_("Created tax %s."), "'%s'" % template.name) # Update tax else: - for key, value in self.diff_fields(template, tax).iteritems(): + for key, value in self.diff_fields(template, tax).items(): # We defer update because account might not be created yet if key in {'account_id', 'refund_account_id'}: continue @@ -659,7 +660,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): template = wiz_tax.tax_id tax = wiz_tax.update_tax_id done = False - for key, value in self.diff_fields(template, tax).iteritems(): + for key, value in self.diff_fields(template, tax).items(): if key in {'account_id', 'refund_account_id'}: tax[key] = value done = True diff --git a/account_chart_update/wizard/wizard_chart_update_view.xml b/account_chart_update/wizard/wizard_chart_update_view.xml index 2a5550ada..a9fc794c1 100644 --- a/account_chart_update/wizard/wizard_chart_update_view.xml +++ b/account_chart_update/wizard/wizard_chart_update_view.xml @@ -25,7 +25,7 @@ - +