Reputation: 349
I'm very new in odoo.
I have created a group named "group_food_manager", and a model named "food_account". Now I want to create a list/tree view that :
group_food_manager
group.Here is the action of the list/tree view:
<record id="food_account_action" model="ir.actions.act_window">
<field name="name">Accounts List</field>
<field name="res_model">food_management.food_account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<!--<field name="domain">[('user_id', '=', uid)]</field>--> <---- This works
<field name="domain">['|', ('user_id', '=', uid), ('group_food_manager', 'in', '?????']</field> <- I don't know how to write it...
</record>
So, is it possibile to use domian with group in XML?
Upvotes: 1
Views: 5290
Reputation: 14801
You will need 2 groups: group_food_user
and group_food_manager
. Now you can create 2 record rules (ir.rule
) the same way as for sale.order
.
You will find a nice example at sale_security.
Upvotes: 1
Reputation: 26768
You can use groups_id
field.
<field name="groups_id" eval="[(4, ref('module_name.group_food_manager'))]"/>
Upvotes: 1