diff --git a/crock_base/__init__.py b/crock_base/__init__.py
new file mode 100644
index 0000000..0650744
--- /dev/null
+++ b/crock_base/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/crock_base/__manifest__.py b/crock_base/__manifest__.py
new file mode 100644
index 0000000..419cc00
--- /dev/null
+++ b/crock_base/__manifest__.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+{
+ "name": "CROCK Base",
+ "version": "1.0.0",
+ "summary": """
+ TODO
+ """,
+ "description": """
+ """,
+ "author": "RemiFr82",
+ "website": "https://remifr82.me",
+ "license": "AGPL-3",
+ "category": "Technical",
+ "depends": [
+ "base",
+ "contacts",
+ "ffck_commons",
+ "l10n_fr_department_oversea",
+ ],
+ "data": [
+ # Base data
+ # "data/ir_model.xml",
+ # Security
+ # 'security/res_groups.xml',
+ # 'security/ir.model.access.csv',
+ # 'security/ir_rule.xml',
+ # Views
+ "views/res_partner.xml",
+ # Wizards
+ # 'wizards/transient_model.xml',
+ # Reports
+ # 'reports/report_assets.xml',
+ # 'reports/report_templates.xml',
+ # 'reports/sql_view.xml',
+ ],
+ # 'assets': {
+ # 'web.report_assets_common': [
+ # 'ffck_color_paddles/static/src/scss/report_pdf.scss',
+ # ],
+ # },
+ "demo": [],
+ "auto_install": False,
+ "external_dependencies": [],
+ "application": True,
+ "css": [],
+ "images": [],
+ "installable": True,
+ "maintainer": "RemiFr82",
+ "pre_init_hook": "",
+ "post_init_hook": "",
+ "uninstall_hook": "",
+}
diff --git a/crock_base/data/res_partner.xml b/crock_base/data/res_partner.xml
new file mode 100644
index 0000000..d9c0c34
--- /dev/null
+++ b/crock_base/data/res_partner.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Comité Départemental de CK&SP de l'Ariège
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CDCK 09
+
+
+
+
\ No newline at end of file
diff --git a/crock_base/models/__init__.py b/crock_base/models/__init__.py
new file mode 100644
index 0000000..91fed54
--- /dev/null
+++ b/crock_base/models/__init__.py
@@ -0,0 +1 @@
+from . import res_partner
diff --git a/crock_base/models/res_partner.py b/crock_base/models/res_partner.py
new file mode 100644
index 0000000..9c359e0
--- /dev/null
+++ b/crock_base/models/res_partner.py
@@ -0,0 +1,35 @@
+from odoo import models, api
+
+
+class ResPartner(models.Model):
+ _inherit = "res.partner"
+ _order = "is_company desc, country_id, department_id, display_name, id"
+
+ @api.onchange("state_id")
+ def _onchange_state_id(self):
+ state = self.state_id
+ if state:
+ if self.partner_scale in ["dept", "loc"]:
+ crck = self.search(
+ [("partner_scale", "=", "reg"), ("state_id", "=", state)], limit=1
+ )
+ if crck and crck != self.crck_partner_id:
+ main = self.env.ref("base.main_partner")
+ if self.crck_partner_id != main:
+ self.crck_partner_id = main
+ elif self.partner_scale == "reg":
+ self.crck_partner_id = self
+
+ @api.onchange("department_id")
+ def _onchange_department_id(self):
+ dept = self.department_id
+ if dept and self.partner_scale == "loc":
+ cdck = self.search(
+ [("partner_scale", "=", "dep"), ("department_id", "=", dept)], limit=1
+ )
+ if cdck and cdck != self.cdck_partner_id:
+ main = self.env.ref("base.main_partner")
+ if self.cdck_partner_id != main:
+ self.cdck_partner_id = main
+ elif self.partner_scale == "dep":
+ self.cdck_partner_id = self
diff --git a/crock_base/static/description/icon.png b/crock_base/static/description/icon.png
new file mode 100755
index 0000000..a062e1b
Binary files /dev/null and b/crock_base/static/description/icon.png differ
diff --git a/crock_base/views/res_partner.xml b/crock_base/views/res_partner.xml
new file mode 100644
index 0000000..a56225a
--- /dev/null
+++ b/crock_base/views/res_partner.xml
@@ -0,0 +1,8 @@
+
+
+
+
+ {'default_is_company': True, 'search_default_country_department_groupby': 1}
+
+
+
\ No newline at end of file