Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
For indention between parent and child records in a tree view, there is the field_parent tag in the view definition:
<record id="list_view" model="ir.ui.view">
<field name="name">model view</field>
<field name="arch" type="xml">
<tree string="Partner Categories">
. . .
<field name="parent_id" invisible="1"/>
. . .
Do I have to use the fields 'parent_id' and 'child_ids' or can I use any fields, like 'my_parent_id' or 'child_object_ids'??
Is the invisible parent_id in the view mandatory?
Is a domain in the view action mandatory: [('parent_id', '=', False)] ?
Does the indention work with list views (view_type: form, view_mode: tree,form)?
Thanks for your help.
'parent_id' Field name is mandatory.
In the ORM File Class BaseModel _parent_name = 'parent_id' is defined.
And in the Document mentioned parent_left and parent_right are special fields that are related to the parent_id field
'child_ids' Field name can change.
To Check the sql query:-
select arch,name,field_parent,id,type,inherit_id,model from ir_ui_view where field_parent is not null
Invisible parent_id and domain is Not mandatory. (You can check using the above query arch column).
If you are using parent_id in the domain, action then need to define invisible parent_id.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/20/14, 8:17 AM|
|Seen: 2935 times|
|Last updated: 3/16/15, 8:10 AM|