Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4476 Vistas

Hello, I need to choose each time between two trees as the view mode on one2many field in xml file :

I defined too tree in my xml file as follows : 

<record model="ir.ui.view" id="my_tree">

<field name="name">name</field>
<field name="model">model.model</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree editable="bottom" domain="[('widget.view.is_action_enabled('edit')', '=', False)]">
<field name="employee_id"/>
<field name="company_id"/>
</tree>
<tree domain="[('widget.view.is_action_enabled('edit')', '!=', False)]">
<field name="employee_id"/>
<field name="company_id"/>
</tree>
</field>
</record>

when I mentioned <tree editable="bottom"> I will add attachment through tree view itself only. it is looking fine for me. But when I have saved current record and click on row of tree view that is one of the attachment it will not redirect to file details or ir attachment form view. but if i did not mentioned editable="bottom" then it will redirect to form view for same case.

Thank you in Advance :)

Avatar
Descartar
Mejor respuesta

I didn't try it, but I think you can do that by creating two pages and put a tree in a page, you can then switch between pages based on a condition. A page could be made invisible based on a condition when the view is displayed, but, I think, you could not hide a page interactively.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
nov 18
13187
1
sept 15
5019
1
mar 15
4866
2
dic 23
20949
0
mar 22
2021