diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 5b5cf98497b..8f250456522 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -596,7 +596,7 @@ class WizardMultiChartsAccounts(models.TransientModel): if self.chart_template_id.complete_tax_set: # default tax is given by the lowest sequence. For same sequence we will take the latest created as it will be the case for tax created while isntalling the generic chart of account chart_ids = self._get_chart_parent_ids(self.chart_template_id) - base_tax_domain = [('chart_template_id', 'in', chart_ids)] + base_tax_domain = [('chart_template_id', 'parent_of', chart_ids)] sale_tax_domain = base_tax_domain + [('type_tax_use', '=', 'sale')] purchase_tax_domain = base_tax_domain + [('type_tax_use', '=', 'purchase')] sale_tax = tax_templ_obj.search(sale_tax_domain, order="sequence, id desc", limit=1) diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py index 237f2655f36..16aa3c7ff5c 100644 --- a/addons/account/models/res_config.py +++ b/addons/account/models/res_config.py @@ -182,10 +182,10 @@ class AccountConfigSettings(models.TransientModel): ir_values_obj = self.env['ir.values'] # default tax is given by the lowest sequence. For same sequence we will take the latest created as it will be the case for tax created while isntalling the generic chart of account sale_tax = tax_templ_obj.search( - [('chart_template_id', '=', self.chart_template_id.id), ('type_tax_use', '=', 'sale')], limit=1, + [('chart_template_id', 'parent_of', self.chart_template_id.id), ('type_tax_use', '=', 'sale')], limit=1, order="sequence, id desc") purchase_tax = tax_templ_obj.search( - [('chart_template_id', '=', self.chart_template_id.id), ('type_tax_use', '=', 'purchase')], limit=1, + [('chart_template_id', 'parent_of', self.chart_template_id.id), ('type_tax_use', '=', 'purchase')], limit=1, order="sequence, id desc") self.sale_tax_id = sale_tax self.purchase_tax_id = purchase_tax diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml index 25de6aed4e4..b57d17fa9e8 100644 --- a/addons/account/views/res_config_view.xml +++ b/addons/account/views/res_config_view.xml @@ -56,13 +56,13 @@