Add tree view and editable on tree

This commit is contained in:
michel 2017-11-16 17:57:33 +01:00
parent 48255707e4
commit 0aba5d585e
2 changed files with 16 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<!-- Action to open Coworkers list --> <!-- Action to open Coworkers list -->
<act_window id="relation_action" name="Relation" <act_window id="relation_action" name="Relation"
res_model="coworking.relation" view_mode="form" /> res_model="coworking.relation" view_mode="tree" />
<!-- Menu item to open Event list --> <!-- Menu item to open Event list -->
<menuitem id="relation_menu" name="Relation" action="relation_action" /> <menuitem id="relation_menu" name="Relation" action="relation_action" />

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<!-- Form --> <!-- Form -->
<record id="view_form_relation" model="ir.ui.view"> <record id="view_form_relation" model="ir.ui.view">
<field name="name">Relation Form</field> <field name="name">Relation Form</field>
@ -10,8 +11,8 @@
<sheet> <sheet>
<group name="group_top"> <group name="group_top">
<group name="group_left"> <group name="group_left">
<field name="coworker1" domain="[('coworker2', '&lt;=', uid)]" /> <field name="coworker1" domain="[('id', '!=', coworker2)]" />
<field name="coworker2" domain="[('coworker1', '&lt;=', uid)]" /> <field name="coworker2" domain="[('id', '!=', coworker1)]" />
<field name="relation" /> <field name="relation" />
</group> </group>
</group> </group>
@ -20,5 +21,17 @@
</field> </field>
</record> </record>
<!-- Tree -->
<record id="view_tree_relation" model="ir.ui.view">
<field name="name">relation Tree</field>
<field name="model">coworking.relation</field>
<field name="arch" type="xml">
<tree editable="True">
<field name="coworker1" domain="[('id', '!=', coworker2)]" />
<field name="coworker2" domain="[('id', '!=', coworker1)]" />
<field name="relation" />
</tree>
</field>
</record>
</odoo> </odoo>