Skip to content

Commit

Permalink
A user can only select the operating units that he is allowed (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow authored and AdriaGForgeFlow committed Nov 16, 2018
1 parent 5215913 commit 5bf040c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions operating_unit/security/operating_unit_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

<record id="ir_rule_operating_unit_allowed_operating_units"
model="ir.rule">
<field name="model_id" ref="model_operating_unit"/>
<field name="domain_force">[('id','in',[g.id for g in user.operating_unit_ids])]</field>
<field name="name">Allowed operating units</field>
<field name="global" eval="True"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>

</odoo>

0 comments on commit 5bf040c

Please sign in to comment.