Skip to content
Snippets Groups Projects
Commit 0c679850 authored by Toufik Benjaa's avatar Toufik Benjaa Committed by Pierre Masereel
Browse files

[FIX] l10n_de, l10n_mx, l10n_nl: bad command sent to ORM

When we get the existing tags to append them a new id, we don't get a
list of id but a list of tuple with one id, this only append if you have
more than one accounting of these country installed, as the first time
it will return an empty list. So the command sent to the ORM, is not
built correctly.

To fix this we just append commands '4' that will be append in a list.
parent fa6774b8
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@ class AccountChartTemplate(models.Model):
def _prepare_transfer_account_for_direct_creation(self, name, company):
res = super(AccountChartTemplate, self)._prepare_transfer_account_for_direct_creation(name, company)
xml_id = self.env.ref('l10n_de.tag_de_asset_bs_B_III_2').id
existing_tags = [x[-1:] for x in res.get('tag_ids', [])]
res['tag_ids'] = [(6, 0, existing_tags + [xml_id])]
res.setdefault('tag_ids', [])
res['tag_ids'].append((4, xml_id))
return res
# Write paperformat and report template used on company
......
......@@ -45,6 +45,6 @@ class AccountChartTemplate(models.Model):
def _prepare_transfer_account_for_direct_creation(self, name, company):
res = super(AccountChartTemplate, self)._prepare_transfer_account_for_direct_creation(name, company)
xml_id = self.env.ref('l10n_mx.account_tag_102_01').id
existing_tags = [x[-1:] for x in res.get('tag_ids', [])]
res['tag_ids'] = [(6, 0, existing_tags + [xml_id])]
res.setdefault('tag_ids', [])
res['tag_ids'].append((4, xml_id))
return res
......@@ -18,6 +18,6 @@ class AccountChartTemplate(models.Model):
def _prepare_transfer_account_for_direct_creation(self, name, company):
res = super(AccountChartTemplate, self)._prepare_transfer_account_for_direct_creation(name, company)
xml_id = self.env.ref('l10n_nl.account_tag_25').id
existing_tags = [x[-1:] for x in res.get('tag_ids', [])]
res['tag_ids'] = [(6, 0, existing_tags + [xml_id])]
res.setdefault('tag_ids', [])
res['tag_ids'].append((4, xml_id))
return res
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment