Add children field Many2One on ir.ui.view

This commit is contained in:
Cédric Krier
2024-02-22 17:39:16 +01:00
parent c18c7dd927
commit 2502e07bb3
3 changed files with 13 additions and 3 deletions
+10
View File
@@ -27,6 +27,16 @@ class View(
fields.fmany2one(
'model_ref', 'model', 'ir.model,model', "Model",
ondelete='CASCADE'),
fields.fmany2one(
'field_children', 'field_childs,model',
'ir.model.field,name,model',
"Children Field",
domain=[
('model', '=', Eval('model')),
],
states={
'invisible': Eval('type') != 'tree',
}),
ModelSQL, ModelView):
"View"
__name__ = 'ir.ui.view'
+2 -2
View File
@@ -12,8 +12,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="domain" widget="pyson"/>
<label name="priority"/>
<field name="priority"/>
<label name="field_childs"/>
<field name="field_childs"/>
<label name="field_children"/>
<field name="field_children"/>
<label name="module"/>
<field name="module"/>
<label name="name"/>
+1 -1
View File
@@ -7,5 +7,5 @@ this repository contains the full copyright notices and license terms. -->
<field name="type"/>
<field name="inherit" expand="1" optional="0"/>
<field name="domain" expand="1" optional="1"/>
<field name="field_childs" optional="1"/>
<field name="field_children" optional="1"/>
</tree>