Skip to content
Snippets Groups Projects
Commit cbe66ef2 authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[MIG] l10n_be: Migrate l10n_be_demo.yml in new API

parent 93c0115d
No related branches found
No related tags found
No related merge requests found
-
Set the demo tags on account templates and on their respective accounts (already generated during the loading of data)
-
!python {model: account.account.template} : |
!python {model: account.account.template, id: False}: |
mapping_list = [
('a1000', 'account.demo_capital_account'),
('a300', 'account.demo_stock_account'),
......@@ -10,9 +10,9 @@
('a24011', 'account.demo_coffee_machine_account'),
]
for xml_id, tag in mapping_list:
account_template = self.browse(cr, uid, ref(xml_id))
self.write(cr, uid, account_template.id, {'tag_ids': [(4, ref(tag))]})
account_ids = self.pool.get('account.account').search(cr, uid, [('code', 'like', account_template.code)])
if account_ids:
self.pool.get('account.account').write(cr, uid, account_ids, {'tag_ids': [(4,ref(tag))]})
account_template = self.browse(ref(xml_id))
account_template.write({'tag_ids': [(4, ref(tag))]})
accounts = self.env['account.account'].search([('code', 'like', account_template.code)])
if accounts:
accounts.write({'tag_ids': [(4,ref(tag))]})
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