Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
e9895dbc
Commit
e9895dbc
authored
7 years ago
by
Yannick Tivisse
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] l10n_be: Convert yml demo data into xml
parent
7a22cbe5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
addons/l10n_be/__manifest__.py
+1
-1
1 addition, 1 deletion
addons/l10n_be/__manifest__.py
addons/l10n_be/demo/l10n_be_demo.xml
+38
-0
38 additions, 0 deletions
addons/l10n_be/demo/l10n_be_demo.xml
addons/l10n_be/demo/l10n_be_demo.yml
+0
-18
0 additions, 18 deletions
addons/l10n_be/demo/l10n_be_demo.yml
with
39 additions
and
19 deletions
addons/l10n_be/__manifest__.py
+
1
−
1
View file @
e9895dbc
...
...
@@ -54,7 +54,7 @@ Wizards provided by this module:
'
data/menuitem_data.xml
'
,
],
'
demo
'
:
[
'
demo/l10n_be_demo.
y
ml
'
,
'
demo/l10n_be_demo.
x
ml
'
,
],
'
website
'
:
'
https://www.odoo.com/page/accounting
'
,
'
post_init_hook
'
:
'
load_translations
'
,
...
...
This diff is collapsed.
Click to expand it.
addons/l10n_be/demo/l10n_be_demo.xml
0 → 100644
+
38
−
0
View file @
e9895dbc
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record
id=
"l10n_be.a1000"
model=
"account.account.template"
>
<field
name=
"tag_ids"
eval=
"[(4, ref('account.demo_capital_account'))]"
/>
</record>
<record
id=
"l10n_be.a300"
model=
"account.account.template"
>
<field
name=
"tag_ids"
eval=
"[(4, ref('account.demo_stock_account'))]"
/>
</record>
<record
id=
"l10n_be.a7600"
model=
"account.account.template"
>
<field
name=
"tag_ids"
eval=
"[(4, ref('account.demo_sale_of_land_account'))]"
/>
</record>
<record
id=
"l10n_be.a6201"
model=
"account.account.template"
>
<field
name=
"tag_ids"
eval=
"[(4, ref('account.demo_ceo_wages_account'))]"
/>
</record>
<record
id=
"l10n_be.a24011"
model=
"account.account.template"
>
<field
name=
"tag_ids"
eval=
"[(4, ref('account.demo_coffee_machine_account'))]"
/>
</record>
<function
model=
"account.account"
name=
"write"
>
<value
model=
"account.account"
search=
"[('code', 'like', obj().env.ref('l10n_be.a1000').code)]"
/>
<value
eval=
"{'tag_ids': [(4, ref('account.demo_capital_account'))]}"
/>
</function>
<function
model=
"account.account"
name=
"write"
>
<value
model=
"account.account"
search=
"[('code', 'like', obj().env.ref('l10n_be.a300').code)]"
/>
<value
eval=
"{'tag_ids': [(4, ref('account.demo_stock_account'))]}"
/>
</function>
<function
model=
"account.account"
name=
"write"
>
<value
model=
"account.account"
search=
"[('code', 'like', obj().env.ref('l10n_be.a7600').code)]"
/>
<value
eval=
"{'tag_ids': [(4, ref('account.demo_sale_of_land_account'))]}"
/>
</function>
<function
model=
"account.account"
name=
"write"
>
<value
model=
"account.account"
search=
"[('code', 'like', obj().env.ref('l10n_be.a6201').code)]"
/>
<value
eval=
"{'tag_ids': [(4, ref('account.demo_ceo_wages_account'))]}"
/>
</function>
<function
model=
"account.account"
name=
"write"
>
<value
model=
"account.account"
search=
"[('code', 'like', obj().env.ref('l10n_be.a24011').code)]"
/>
<value
eval=
"{'tag_ids': [(4, ref('account.demo_coffee_machine_account'))]}"
/>
</function>
</odoo>
This diff is collapsed.
Click to expand it.
addons/l10n_be/demo/l10n_be_demo.yml
deleted
100644 → 0
+
0
−
18
View file @
7a22cbe5
-
Set the demo tags on account templates and on their respective accounts (already generated during the loading of data)
-
!python
{
model
:
account.account.template
,
id
:
False
}
:
|
mapping_list = [
('a1000', 'account.demo_capital_account'),
('a300', 'account.demo_stock_account'),
('a7600', 'account.demo_sale_of_land_account'),
('a6201', 'account.demo_ceo_wages_account'),
('a24011', 'account.demo_coffee_machine_account'),
]
for xml_id, tag in mapping_list:
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))]})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment