diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index c818bf483c207071f88543f2bbaaaaa8363dda9a..658ea35458a8044306a690cf97ee97080993a6c5 100755 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,11 +1,11 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_scop_cotisation_simulation,access_scop_cotisation_simulation,model_scop_cotisation_cg_simulation,account.group_account_manager,1,1,1,1 +access_scop_cotisation_simulation,access_scop_cotisation_simulation,model_scop_cotisation_cg_simulation,cgscop_cotisation_cg.group_cotisation_cg_administrative,1,1,1,1 admin_access_scop_cotisation_simulation,admin_access_scop_cotisation_simulation,model_scop_cotisation_cg_simulation,cgscop_partner.group_cg_administrator,1,1,1,1 -access_scop_cotisation_cg,access_scop_cotisation_cg,model_scop_cotisation_cg,account.group_account_manager,1,1,1,0 +access_scop_cotisation_cg,access_scop_cotisation_cg,model_scop_cotisation_cg,cgscop_cotisation_cg.group_cotisation_cg_administrative,1,1,1,0 admin_access_scop_cotisation_cg,admin_access_scop_cotisation_cg,model_scop_cotisation_cg,cgscop_partner.group_cg_administrator,1,1,1,1 -access_scop_bordereau,access_scop_bordereau,model_scop_bordereau,account.group_account_manager,1,1,1,1 +access_scop_bordereau,access_scop_bordereau,model_scop_bordereau,cgscop_cotisation_cg.group_cotisation_cg_administrative,1,1,1,1 admin_access_scop_bordereau,admin_access_scop_bordereau,model_scop_bordereau,cgscop_partner.group_cg_administrator,1,1,1,1 -access_scop_bordereau_version,access_scop_bordereau_version,model_scop_bordereau_version,account.group_account_manager,1,1,1,1 +access_scop_bordereau_version,access_scop_bordereau_version,model_scop_bordereau_version,cgscop_cotisation_cg.group_cotisation_cg_administrative,1,1,1,1 admin_access_scop_bordereau_version,admin_access_scop_bordereau_version,model_scop_bordereau_version,cgscop_partner.group_cg_administrator,1,1,1,1 -access_scop_bordereau_refund_wizard_quarter,access_scop_bordereau_refund_wizard_quarter,model_scop_bordereau_refund_wizard_quarter,account.group_account_manager,1,1,1,1 +access_scop_bordereau_refund_wizard_quarter,access_scop_bordereau_refund_wizard_quarter,model_scop_bordereau_refund_wizard_quarter,cgscop_cotisation_cg.group_cotisation_cg_administrative,1,1,1,1 admin_access_scop_bordereau_refund_wizard_quarter,admin_access_scop_bordereau_refund_wizard_quarter,model_scop_bordereau_refund_wizard_quarter,cgscop_partner.group_cg_administrator,1,1,1,1 diff --git a/security/security_rules.xml b/security/security_rules.xml index ebb8d7e2919168b8f57243a22aa1595b65536067..a4f7a2f581cf2101a68e0cbb1fd3ebf96e4a448e 100644 --- a/security/security_rules.xml +++ b/security/security_rules.xml @@ -5,6 +5,23 @@ <odoo> <data noupdate="0"> + <!-- Categories & Groups --> + + <!-- Add Cotisations group category --> + <record model="ir.module.category" id="cgscop_cotisation_cg_module_category"> + <field name="name">Cotisation</field> + </record> + + <!-- Add cotisations groups --> + <record id="group_cotisation_cg_administrative" model="res.groups"> + <field name="name">Gestionnaire des cotisations</field> + <field name="category_id" ref="cgscop_cotisation_cg_module_category"/> + <field name="implied_ids" eval="[(6, 0, [ref('account.group_account_manager')])]"/> + </record> + + <!-- Rules --> + + <!-- Cotiz only for own company --> <record id="cg_cotisation_cg_rule" model="ir.rule"> <field name="name">Cotisations consultables que pour sa société</field> <field name="model_id" ref="cgscop_cotisation_cg.model_scop_cotisation_cg"/> @@ -15,6 +32,7 @@ <field name="perm_unlink" eval="True"/> </record> + <!-- Bordereaux only for own company --> <record id="cg_cotisation_cg_rule" model="ir.rule"> <field name="name">Bordereaux consultables que pour sa société</field> <field name="model_id" ref="cgscop_cotisation_cg.model_scop_bordereau"/> @@ -25,5 +43,27 @@ <field name="perm_unlink" eval="True"/> </record> + <!-- Service Admin grant all access --> + <record id="scop_cotisation_cg_admin" model="ir.rule"> + <field name="name">Cotisations - Modification - Service Administratif</field> + <field name="model_id" ref="cgscop_cotisation_cg.model_scop_cotisation_cg"/> + <field name="domain_force">[(1,'=',1)]</field> + <field name="groups" eval="[(6, 0, [ref('group_cotisation_cg_administrative')])]"/> + <field name="perm_read" eval="True"/> + <field name="perm_write" eval="True"/> + <field name="perm_create" eval="True"/> + <field name="perm_unlink" eval="True"/> + </record> + <record id="scop_bordereau_admin" model="ir.rule"> + <field name="name">Bordereaux - Modification - Service Administratif</field> + <field name="model_id" ref="cgscop_cotisation_cg.model_scop_bordereau"/> + <field name="domain_force">[(1,'=',1)]</field> + <field name="groups" eval="[(6, 0, [ref('group_cotisation_cg_administrative')])]"/> + <field name="perm_read" eval="True"/> + <field name="perm_write" eval="True"/> + <field name="perm_create" eval="True"/> + <field name="perm_unlink" eval="True"/> + </record> + </data> </odoo> \ No newline at end of file diff --git a/views/account_invoice.xml b/views/account_invoice.xml index 4152cb02a4984181b44c9d99c2b5d12232f7cd6b..59350d0695461b75df11eb0ae7b2cf0eff9fccf9 100644 --- a/views/account_invoice.xml +++ b/views/account_invoice.xml @@ -95,6 +95,7 @@ <menuitem id="menu_scop_cotisation_cg_appel_cotisation" name="Appels de cotisations" parent="cgscop_cotisation.menu_scop_cotisation" + groups="cgscop_cotisation_cg.group_cotisation_cg_administrative" action="action_scop_cg_appel_cotisation" sequence="20"/> diff --git a/views/scop_bordereau_cg.xml b/views/scop_bordereau_cg.xml index 6494508a4169ec9c94e661361e14b303d27fedf7..e7685d186201b3604aa3f2e348abe75e66746e4c 100644 --- a/views/scop_bordereau_cg.xml +++ b/views/scop_bordereau_cg.xml @@ -237,6 +237,7 @@ <menuitem name="Bordereaux" id="scop_bordereau_menu" parent="cgscop_cotisation.menu_scop_cotisation" + groups="cgscop_cotisation_cg.group_cotisation_cg_administrative" action="scop_bordereau_act_window" sequence="30"/> diff --git a/views/scop_cotisation_cg.xml b/views/scop_cotisation_cg.xml index acb085b9b654269acce3ecc751c75ffdfd233e03..58b288ddbfeeb461dab99082b5321521fdc929f9 100644 --- a/views/scop_cotisation_cg.xml +++ b/views/scop_cotisation_cg.xml @@ -159,6 +159,7 @@ <!-- MENUS --> <menuitem id="menu_scop_cotisation_cg_calcul" parent="cgscop_cotisation.menu_scop_cotisation" + groups="cgscop_cotisation_cg.group_cotisation_cg_administrative" action="action_scop_cotisation_cg" sequence="10"/> </data>