Browse Source

[ADD] b_shift : attendance sheet access rules

pull/125/head
Elouan Le Bars 5 years ago
parent
commit
2367e2ce60
  1. 13
      beesdoo_shift/security/group.xml
  2. 15
      beesdoo_shift/security/ir.model.access.csv
  3. 10
      beesdoo_shift/views/attendance_sheet.xml
  4. 1
      beesdoo_shift/views/attendance_sheet_admin.xml
  5. 4
      beesdoo_shift/views/cooperative_status.xml
  6. 40
      beesdoo_shift/views/res_config_view.xml
  7. 2
      beesdoo_shift/views/task.xml
  8. 2
      beesdoo_shift/views/task_template.xml

13
beesdoo_shift/security/group.xml

@ -1,5 +1,9 @@
<odoo> <odoo>
<data noupdate="0">
<data noupdate="1">
<record id="group_shift_attendance_sheet" model="res.groups">
<field name="name">Attendance Sheet Access</field>
<field name="category_id" ref="base.module_category_cooperative_management"/>
</record>
<record id="group_shift_attendance" model="res.groups"> <record id="group_shift_attendance" model="res.groups">
<field name="name">Shift Attendance</field> <field name="name">Shift Attendance</field>
<field name="category_id" ref="base.module_category_cooperative_management"/> <field name="category_id" ref="base.module_category_cooperative_management"/>
@ -17,7 +21,10 @@
<record id="group_cooperative_admin" model="res.groups"> <record id="group_cooperative_admin" model="res.groups">
<field name="name">Cooperative Admin</field> <field name="name">Cooperative Admin</field>
<field name="category_id" ref="base.module_category_cooperative_management"/> <field name="category_id" ref="base.module_category_cooperative_management"/>
<field name="implied_ids" eval="[(4, ref('group_planning_management'))]"/>
<field name="implied_ids" eval="[(6, 0, [ref('group_planning_management'),
ref('group_shift_attendance_sheet')])]"
/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record> </record>
</data> </data>
</odoo>
</odoo>

15
beesdoo_shift/security/ir.model.access.csv

@ -1,10 +1,23 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_coopplanning_task_type,Attendance Read Type,model_beesdoo_shift_type,group_shift_attendance,1,0,0,0
access_attendance_sheet_task,Attendance Create Shift,model_beesdoo_shift_shift,group_shift_attendance_sheet,1,1,1,0
access_attendance_sheet_abstract_task,Attendance Sheet Shift Read Abstract (generic),model_beesdoo_shift_sheet_shift,group_shift_attendance_sheet,1,0,0,0
access_attendance_sheet_task_expected,Attendance Sheet Shift Expected (generic),model_beesdoo_shift_sheet_expected,group_shift_attendance_sheet,1,1,1,0
access_attendance_sheet_task_added,Attendance Sheet Shift Added (generic),model_beesdoo_shift_sheet_added,group_shift_attendance_sheet,1,1,1,1
access_attendance_sheet,Attendance Sheet Create (generic),model_beesdoo_shift_sheet,group_shift_attendance_sheet,1,1,1,0
access_attendance_sheet_task_template,Attendance Read Template,model_beesdoo_shift_template,group_shift_attendance_sheet,1,0,0,0
access_coopplanning_task_stage,Attendance Read Stage,model_beesdoo_shift_stage,group_shift_attendance_sheet,1,0,0,0
access_coopplanning_task_type,Attendance Read Type,model_beesdoo_shift_type,group_shift_attendance_sheet,1,0,0,0
access_coopplanning_daynumber,Attendance Read Daynumber,model_beesdoo_shift_daynumber,group_shift_attendance,1,0,0,0 access_coopplanning_daynumber,Attendance Read Daynumber,model_beesdoo_shift_daynumber,group_shift_attendance,1,0,0,0
access_coopplanning_planning,Attendance Read Planning,model_beesdoo_shift_planning,group_shift_attendance,1,0,0,0 access_coopplanning_planning,Attendance Read Planning,model_beesdoo_shift_planning,group_shift_attendance,1,0,0,0
access_coopplanning_task_template,Attendance Read Template,model_beesdoo_shift_template,group_shift_attendance,1,0,0,0 access_coopplanning_task_template,Attendance Read Template,model_beesdoo_shift_template,group_shift_attendance,1,0,0,0
access_coopplanning_task,Attendance Edit Shift,model_beesdoo_shift_shift,group_shift_attendance,1,1,0,0 access_coopplanning_task,Attendance Edit Shift,model_beesdoo_shift_shift,group_shift_attendance,1,1,0,0
access_coopplanning_task_full,Shift Management all Shift,model_beesdoo_shift_shift,group_shift_management,1,1,1,1 access_coopplanning_task_full,Shift Management all Shift,model_beesdoo_shift_shift,group_shift_management,1,1,1,1
admin_access_attendance_sheet,Attendance Sheet Shift Read Abstract,model_beesdoo_shift_sheet_shift,group_cooperative_admin,1,1,1,1
admin_access_attendance_sheet_expected,Attendance Sheet Shift Read Expected,model_beesdoo_shift_sheet_expected,group_cooperative_admin,1,1,1,1
access_coop_status,Coop Status Read for all,model_cooperative_status,,1,0,0,0 access_coop_status,Coop Status Read for all,model_cooperative_status,,1,0,0,0
access_coop_status_all,Coop Status Admin,model_cooperative_status,group_cooperative_admin,1,1,1,1 access_coop_status_all,Coop Status Admin,model_cooperative_status,group_cooperative_admin,1,1,1,1
all_config_coopplanning_task_type,Attendance Read Type,model_beesdoo_shift_type,group_planning_management,1,1,1,1 all_config_coopplanning_task_type,Attendance Read Type,model_beesdoo_shift_type,group_planning_management,1,1,1,1

10
beesdoo_shift/views/attendance_sheet.xml

@ -85,7 +85,9 @@
<h4> Additional important informations </h4> <h4> Additional important informations </h4>
<field name="annotation" /> <field name="annotation" />
<group> <group>
<field name="is_read" />
<field name="is_read"
groups="beesdoo_shift.group_cooperative_admin"
/>
</group> </group>
<h4> General feedback </h4> <h4> General feedback </h4>
<field name="feedback" /> <field name="feedback" />
@ -97,7 +99,10 @@
</group> </group>
</sheet> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_ids"
widget="mail_thread"
groups="beesdoo_shift.group_cooperative_admin"
/>
</div> </div>
</form> </form>
</field> </field>
@ -120,6 +125,7 @@
<menuitem id="menu_sheet_top" <menuitem id="menu_sheet_top"
name="Attendance Sheets" name="Attendance Sheets"
parent="menu_root" parent="menu_root"
groups="beesdoo_shift.group_shift_attendance_sheet"
/> />
<!-- Menu actions --> <!-- Menu actions -->

1
beesdoo_shift/views/attendance_sheet_admin.xml

@ -34,6 +34,7 @@
<menuitem id="menu_sheet_admin_top" <menuitem id="menu_sheet_admin_top"
name="Attendance Sheets Administration" name="Attendance Sheets Administration"
parent="menu_root" parent="menu_root"
groups="beesdoo_shift.group_cooperative_admin"
/> />
<!-- Menu actions --> <!-- Menu actions -->

4
beesdoo_shift/views/cooperative_status.xml

@ -179,7 +179,7 @@
</record> </record>
<menuitem name="Worker" id="menu_worker_top" parent="menu_root" <menuitem name="Worker" id="menu_worker_top" parent="menu_root"
sequence="1" />
groups="beesdoo_shift.group_shift_attendance" sequence="1" />
<menuitem name="Worker" id="menu_worker" parent="menu_worker_top" <menuitem name="Worker" id="menu_worker" parent="menu_worker_top"
action="action_worker" /> action="action_worker" />
@ -192,5 +192,3 @@
<menuitem name="Counter Update Journal" id="menu_journal" parent="menu_status_top" <menuitem name="Counter Update Journal" id="menu_journal" parent="menu_status_top"
action="action_journal" groups="beesdoo_shift.group_cooperative_admin" /> action="action_journal" groups="beesdoo_shift.group_cooperative_admin" />
</odoo> </odoo>

40
beesdoo_shift/views/res_config_view.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019-2020 Elouan Le Bars <elouan@coopiteasy.be>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<record model="ir.ui.view" id="shift_settings_view_form">
<field name="name">Shifts Configuration Form</field>
<field name="model">beesdoo.shift.config.settings</field>
<field name="arch" type="xml">
<form string="Settings" class="oe_form_configuration" create="false" delete="false" >
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<separator string="General Settings"/>
<group name="Attendance Sheets">
<field name="default_task_type_id"/>
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_shift_settings">
<field name="name">Settings</field>
<field name="res_model">beesdoo.shift.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<menuitem name="Settings"
id="menu_shift_settings"
parent="menu_configuration_top"
action="action_shift_settings"
groups="beesdoo_shift.group_cooperative_admin"
/>
</data>
</openerp>

2
beesdoo_shift/views/task.xml

@ -219,7 +219,7 @@
<!-- Top menu item --> <!-- Top menu item -->
<menuitem name="Planning" id="menu_task_top" parent="menu_root" <menuitem name="Planning" id="menu_task_top" parent="menu_root"
sequence="1" />
sequence="1" groups="beesdoo_shift.group_shift_attendance" />
<!-- actions --> <!-- actions -->
<menuitem name="Shift" id="menu_task" parent="menu_task_top" <menuitem name="Shift" id="menu_task" parent="menu_task_top"
action="action_task" groups="beesdoo_shift.group_shift_management" /> action="action_task" groups="beesdoo_shift.group_shift_management" />

2
beesdoo_shift/views/task_template.xml

@ -178,7 +178,7 @@
</record> </record>
<menuitem name="Shift Management" id="menu_root" <menuitem name="Shift Management" id="menu_root"
groups="beesdoo_shift.group_shift_attendance" />
groups="beesdoo_shift.group_shift_attendance_sheet" />
<menuitem name="Templates" id="menu_template_top" parent="menu_root" <menuitem name="Templates" id="menu_template_top" parent="menu_root"
groups="beesdoo_shift.group_shift_management" /> groups="beesdoo_shift.group_shift_management" />

Loading…
Cancel
Save