This question has been flagged
1918 Views

i try to add a field in a user form for allowed locations and write a rule for that but when i add this rule the user cant open the products form and also not able  to create any products. How can i restrict warehouse and locations from  user

<record id="location_restriction" model="ir.rule">
<field
name="name">Stock location Allowed</field>
<field
name="model_id" search="[('model','=','stock.location')]" model="ir.model"/>
<field
name="groups" eval="[(4, ref('base.group_user'))]"/>
<field
name="domain_force">[('id','in', [ p.id for p in user.stock_location_id ])]</field>
</record>


Avatar
Discard