Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][IMP] fieldservice_route: Add access rules and permissions for fsm_route, fsm_route_day and fsm_route_dayroute models #1297

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fieldservice_route/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"data/ir_sequence.xml",
"data/fsm_route_day_data.xml",
"data/fsm_stage_data.xml",
"security/ir_rule.xml",
"security/ir.model.access.csv",
"views/fsm_route_day.xml",
"views/fsm_route.xml",
Expand Down
6 changes: 6 additions & 0 deletions fieldservice_route/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_fsm_route_user,fsm.route.user,model_fsm_route,fieldservice.group_fsm_user,1,0,0,0
access_fsm_route_user_own,fsm.route.user.own,model_fsm_route,fieldservice.group_fsm_user_own,1,0,0,0
access_fsm_route_dispatcher,fsm.route.dispatcher,model_fsm_route,fieldservice.group_fsm_dispatcher,1,1,1,1
access_fsm_route_manager,fsm.route.manager,model_fsm_route,fieldservice.group_fsm_manager,1,1,1,1
access_fsm_route_day_user,fsm.route.day.user,model_fsm_route_day,fieldservice.group_fsm_user,1,0,0,0
access_fsm_route_day_user_own,fsm.route.day.user.own,model_fsm_route_day,fieldservice.group_fsm_user_own,1,0,0,0
access_fsm_route_day_dispatcher,fsm.route.day.dispatcher,model_fsm_route_day,fieldservice.group_fsm_manager,1,1,0,0
access_fsm_route_day_manager,fsm.route.day.manager,model_fsm_route_day,fieldservice.group_fsm_manager,1,1,1,1
access_fsm_route_dayroute_user,fsm.route.dayroute.user,model_fsm_route_dayroute,fieldservice.group_fsm_user,1,1,0,0
access_fsm_route_dayroute_user_own,fsm.route.dayroute.user.own,model_fsm_route_dayroute,fieldservice.group_fsm_user_own,1,0,0,0
access_fsm_route_dayroute_dispatcher,fsm.route.dayroute.dispatcher,model_fsm_route_dayroute,fieldservice.group_fsm_dispatcher,1,1,1,1
access_fsm_route_dayroute_manager,fsm.route.dayroute.manager,model_fsm_route_dayroute,fieldservice.group_fsm_manager,1,1,1,1
access_fsm_route_dayroute_portal,access.fsm.route.dayroute.portal,model_fsm_route_dayroute,base.group_portal,1,1,1,0
access_ir_sequence_portal,access.ir.sequence.portal,base.model_ir_sequence,base.group_portal,1,0,0,0
36 changes: 36 additions & 0 deletions fieldservice_route/security/ir_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="fsm_route_own_rule" model="ir.rule">
<field name="name">FSM Routes Entry (only own)</field>
<field name="model_id" ref="model_fsm_route" />
<field
name="domain_force"
>['|',('fsm_person_id.user_ids','=',user.id),('fsm_person_id','=',False)]</field>
<field name="groups" eval="[(4, ref('fieldservice.group_fsm_user_own'))]" />
</record>

<record id="fsm_route_user" model="ir.rule">
<field name="name">FSM Routes Entry</field>
<field name="model_id" ref="model_fsm_route" />
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('fieldservice.group_fsm_user'))]" />
</record>

<record id="fsm_route_dayroute_own_rule" model="ir.rule">
<field name="name">FSM Route DayRoutes Entry (only own)</field>
<field name="model_id" ref="model_fsm_route_dayroute" />
<field
name="domain_force"
>['|',('person_id.user_ids','=',user.id),('person_id','=',False)]</field>
<field name="groups" eval="[(4, ref('fieldservice.group_fsm_user_own'))]" />
</record>

<record id="fsm_route_dayroute_user" model="ir.rule">
<field name="name">FSM Route DayRoutes Entry</field>
<field name="model_id" ref="model_fsm_route_dayroute" />
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('fieldservice.group_fsm_user'))]" />
</record>

</odoo>
Loading