From c2588dd4f9a05dcb605494262eca6be6d4c60119 Mon Sep 17 00:00:00 2001
From: jordan <jordan@le-filament.com>
Date: Thu, 21 Jan 2021 11:24:59 +0100
Subject: [PATCH] [update] rename scop_cotisation into scop_cotisation_cg

---
 __manifest__.py                               |  2 +-
 models/__init__.py                            |  2 +-
 models/account_invoice.py                     |  4 ++--
 models/res_config_settings.py                 |  2 +-
 security/ir.model.access.csv                  |  4 ++--
 security/security_rules.xml                   |  2 +-
 ..._cotisation.xml => scop_cotisation_cg.xml} | 22 +++++++++----------
 7 files changed, 19 insertions(+), 19 deletions(-)
 rename views/{scop_cotisation.xml => scop_cotisation_cg.xml} (84%)
 mode change 100755 => 100644

diff --git a/__manifest__.py b/__manifest__.py
index ae601e0..1a7e0b9 100755
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -15,7 +15,7 @@
         "security/security_rules.xml",
         "security/ir.model.access.csv",
         "views/res_config_settings.xml",
-        "views/scop_cotisation.xml",
+        "views/scop_cotisation_cg.xml",
         "views/union_regionale.xml",
     ]
 }
diff --git a/models/__init__.py b/models/__init__.py
index 7f48c9b..0ef1dbe 100755
--- a/models/__init__.py
+++ b/models/__init__.py
@@ -4,5 +4,5 @@
 from . import account_invoice
 from . import res_company
 from . import res_config_settings
-from . import scop_cotisation
+from . import scop_cotisation_cg
 from . import union_regionale
diff --git a/models/account_invoice.py b/models/account_invoice.py
index d56f988..785f3b5 100644
--- a/models/account_invoice.py
+++ b/models/account_invoice.py
@@ -8,8 +8,8 @@ class ScopAccountInvoiceCG(models.Model):
     _inherit = "account.invoice"
 
     cotisation_cg_id = fields.Many2one(
-        comodel_name='scop.cotisation',
-        string='Base de cotisation')
+        comodel_name='scop.cotisation.cg',
+        string='Base de cotisation CG Scop')
     partner_ur_id = fields.Many2one(
         comodel_name='union.regionale',
         string='UR Adhérent',
diff --git a/models/res_config_settings.py b/models/res_config_settings.py
index c5a11db..f0b4451 100644
--- a/models/res_config_settings.py
+++ b/models/res_config_settings.py
@@ -53,7 +53,7 @@ class CotisationsConfigSettings(models.TransientModel):
         res = super(CotisationsConfigSettings, self).execute()
 
         menu_cotiz_cg = self.env.ref(
-            'cgscop_cotisation_cg.menu_scop_cotisation_calcul')
+            'cgscop_cotisation_cg.menu_scop_cotisation_cg_calcul')
         bool_condition = self.is_contribution_cg
 
         self.add_company_to_menu(menu_cotiz_cg, bool_condition)
diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv
index f92304e..3331cf3 100755
--- a/security/ir.model.access.csv
+++ b/security/ir.model.access.csv
@@ -1,3 +1,3 @@
 id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_scop_cotisation,access_scop_cotisation,model_scop_cotisation,account.group_account_manager,1,1,1,0
-admin_access_scop_cotisation,admin_access_scop_cotisation,model_scop_cotisation,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
+admin_access_scop_cotisation_cg,admin_access_scop_cotisation_cg,model_scop_cotisation_cg,cgscop_partner.group_cg_administrator,1,1,1,1
diff --git a/security/security_rules.xml b/security/security_rules.xml
index bdda16b..3e59b35 100644
--- a/security/security_rules.xml
+++ b/security/security_rules.xml
@@ -7,7 +7,7 @@
 
         <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"/>
+            <field name="model_id" ref="cgscop_cotisation_cg.model_scop_cotisation_cg"/>
             <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
             <field name="perm_read" eval="True"/>
             <field name="perm_write" eval="True"/>
diff --git a/views/scop_cotisation.xml b/views/scop_cotisation_cg.xml
old mode 100755
new mode 100644
similarity index 84%
rename from views/scop_cotisation.xml
rename to views/scop_cotisation_cg.xml
index d69bb5c..fdfa8a4
--- a/views/scop_cotisation.xml
+++ b/views/scop_cotisation_cg.xml
@@ -6,9 +6,9 @@
     <data>
 
         <!-- Tree view -->
-        <record id="view_scop_cotisation_tree" model="ir.ui.view">
-            <field name="name">scop.cotisation.tree</field>
-            <field name="model">scop.cotisation</field>
+        <record id="view_scop_cotisation_cg_tree" model="ir.ui.view">
+            <field name="name">scop.cotisation.cg.tree</field>
+            <field name="model">scop.cotisation.cg</field>
             <field name="arch" type="xml">
                 <tree string="Cotisations">
                     <field name="year"/>
@@ -23,9 +23,9 @@
         </record>
 
         <!-- Form view -->
-        <record id="view_scop_cotisation_form" model="ir.ui.view">
-            <field name="name">scop.cotisation.form</field>
-            <field name="model">scop.cotisation</field>
+        <record id="view_scop_cotisation_cg_form" model="ir.ui.view">
+            <field name="name">scop.cotisation.cg.form</field>
+            <field name="model">scop.cotisation.cg</field>
             <field name="arch" type="xml">
                 <form string="Cotisations">
                     <header>
@@ -72,18 +72,18 @@
         </record>
 
         <!-- Action -->
-        <record id="action_scop_cotisation" model="ir.actions.act_window">
-            <field name="name">Base de cotisations</field>
-            <field name="res_model">scop.cotisation</field>
+        <record id="action_scop_cotisation_cg" model="ir.actions.act_window">
+            <field name="name">Base de cotisations CG</field>
+            <field name="res_model">scop.cotisation.cg</field>
             <field name="view_mode">tree,form</field>
             <field name="help">Affiche les bases de calcul des cotisations</field>
         </record>
 
 
         <!-- MENUS -->
-        <menuitem id="menu_scop_cotisation_calcul"
+        <menuitem id="menu_scop_cotisation_cg_calcul"
                   parent="cgscop_cotisation.menu_scop_cotisation"
-                  action="action_scop_cotisation"
+                  action="action_scop_cotisation_cg"
                   sequence="10"/>
     </data>
 </odoo>
-- 
GitLab