Browse Source

[IMP] ffck_commons

16.0
RemiFr82 6 months ago
parent
commit
c0e00106e4
  1. 98
      ffck_commons/i18n/fr.po
  2. 2
      ffck_commons/models/ffck_structure_type.py
  3. 17
      ffck_commons/models/res_partner.py

98
ffck_commons/i18n/fr.po

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-26 13:55+0000\n"
"PO-Revision-Date: 2024-05-26 13:55+0000\n"
"POT-Creation-Date: 2024-05-26 23:35+0000\n"
"PO-Revision-Date: 2024-05-26 23:35+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -20,6 +20,11 @@ msgstr ""
msgid "Active"
msgstr "Actif"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_club
msgid "Affiliate member"
msgstr "Membre affilié"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__cdck_partner_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__cdck_partner_id
@ -37,6 +42,11 @@ msgstr "CRCK"
msgid "Contact"
msgstr ""
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_conv
msgid "Conventioned member"
msgstr "Membre conventionné"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_ffck_structure_type__create_uid
msgid "Created by"
@ -48,11 +58,16 @@ msgid "Created on"
msgstr "Créé le"
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__dep
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__dep
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__3
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__3
msgid "Departmental"
msgstr "Départementale"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_cdck
msgid "Departmental Committee"
msgstr "Comité Départemental"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_ffck_structure_type__display_name
msgid "Display Name"
@ -68,9 +83,11 @@ msgstr ""
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__cdck_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__crck_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__local_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__cdck_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__crck_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__local_partner_code
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__partner_code
msgid "FFCK code"
msgstr "Code FFCK"
@ -81,6 +98,11 @@ msgstr "Code FFCK"
msgid "FFCK network"
msgstr "Réseau FFCK"
#. module: ffck_commons
#: model:ir.ui.menu,name:ffck_commons.ffck_contacts_config_menu
msgid "FFCK params"
msgstr "Config FFCK"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__ffck_partner_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__ffck_partner_id
@ -92,6 +114,16 @@ msgstr "FFCK"
msgid "FFCK structure type"
msgstr "Type de structure"
#. module: ffck_commons
#: model:ir.actions.act_window,name:ffck_commons.ffck_structure_type_action
msgid "FFCK structure types"
msgstr "Types de structures"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_ffck
msgid "Federation"
msgstr "Fédération"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_ffck_structure_type__id
msgid "ID"
@ -118,8 +150,8 @@ msgid "License code"
msgstr "N° de licence"
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__lic
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__lic
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__5
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__5
msgid "Licensee"
msgstr "Licencié"
@ -129,16 +161,16 @@ msgid "Licensee information"
msgstr "Informations licencié"
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__loc
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__loc
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__4
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__4
msgid "Local"
msgstr "Locale"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__license_partner_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__license_partner_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__local_partner_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__local_partner_id
msgid "Local partner"
msgstr "Structure Locale"
msgstr "Structure locale"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_ffck_structure_type__name
@ -146,8 +178,8 @@ msgid "Name"
msgstr "Nom"
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__nat
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__nat
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__1
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__1
msgid "National"
msgstr "Nationale"
@ -162,11 +194,26 @@ msgid "Parent"
msgstr ""
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__reg
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__reg
#: model_terms:ir.ui.view,arch_db:ffck_commons.view_res_partner_filter_inherit_base
msgid "Partner scale"
msgstr "Échelle"
#. module: ffck_commons
#: model_terms:ir.ui.view,arch_db:ffck_commons.view_res_partner_filter_inherit_base
msgid "Persons"
msgstr "Personnes"
#. module: ffck_commons
#: model:ir.model.fields.selection,name:ffck_commons.selection__ffck_structure_type__scale__2
#: model:ir.model.fields.selection,name:ffck_commons.selection__res_partner__partner_scale__2
msgid "Regional"
msgstr "Régionale"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_crck
msgid "Regional Committee"
msgstr "Comité Régional"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_ffck_structure_type__scale
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__partner_scale
@ -203,5 +250,26 @@ msgstr "Infos de la structure"
#. module: ffck_commons
#: model:ir.model.fields,field_description:ffck_commons.field_res_partner__ffck_structure_type_id
#: model:ir.model.fields,field_description:ffck_commons.field_res_users__ffck_structure_type_id
#: model_terms:ir.ui.view,arch_db:ffck_commons.view_res_partner_filter_inherit_base
msgid "Structure type"
msgstr "Type de structure"
#. module: ffck_commons
#: model:ir.ui.menu,name:ffck_commons.ffck_structure_type_menu
msgid "Structure types"
msgstr "Types de structure"
#. module: ffck_commons
#: model_terms:ir.ui.view,arch_db:ffck_commons.view_res_partner_filter_inherit_base
msgid "Structures"
msgstr "Structures"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_agra
msgid "Type A agreed member"
msgstr "Membre agréé Type A"
#. module: ffck_commons
#: model:ffck.structure.type,name:ffck_commons.ffck_structure_type_agrb
msgid "Type B agreed member"
msgstr "Membre agréé Type B"

2
ffck_commons/models/ffck_structure_type.py

@ -17,6 +17,6 @@ class FfckStructureType(models.Model):
name = fields.Char("Name", required=True, translate=True)
short = fields.Char("Short", required=True, index=True)
scale = fields.Selection(SCALES, string="Scale", required=True)
scale = fields.Selection(selection=SCALES, string="Scale", required=True)
active = fields.Boolean(string="Active", default=True)
parent_id = fields.Many2one(comodel_name="ffck.structure.type", string="Parent")

17
ffck_commons/models/res_partner.py

@ -18,7 +18,8 @@ class ResPartner(models.Model):
store=True,
)
ffck_structure_type_id = fields.Many2one(
comodel_name="ffck.structure.type", string="Structure type"
comodel_name="ffck.structure.type",
string="Structure type",
)
partner_code = fields.Char(string="FFCK code", size=6, index=True)
# partner_code_editable = fields.Boolean(string="FFCK code editable", compute="_can_edit_partner_code")
@ -110,10 +111,7 @@ class ResPartner(models.Model):
if partner.company_type == "individual":
partner.partner_scale = "5"
else:
partner.partner_scale = (
partner.ffck_structure_type_id
and partner.ffck_structure_type_id.scale
)
partner.partner_scale = partner.ffck_structure_type_id.scale
def _get_ffck_partner(self):
ffck = self.env.ref("ffck_commons.res_partner_ffck", raise_if_not_found=False)
@ -136,8 +134,9 @@ class ResPartner(models.Model):
("state_id", "in", states.ids),
]
)
crck_by_state = {(crck.state_id, crck) for crck in crck_ok}
states_ok = states - crck_ok.mapped("state_id")
crck_by_state = {crck.state_id: crck for crck in crck_ok}
print(crck_by_state)
states_ok = states & crck_ok.mapped("state_id")
concerned = self.filtered(
lambda rp: rp.ffck_network
and int(rp.partner_scale) >= 3
@ -160,8 +159,8 @@ class ResPartner(models.Model):
("country_department_id", "in", depts.ids),
]
)
cdck_by_dept = {(cdck.country_department_id, cdck) for cdck in cdck_ok}
depts_ok = depts - cdck_ok.mapped("country_department_id")
cdck_by_dept = {cdck.country_department_id: cdck for cdck in cdck_ok}
depts_ok = depts & cdck_ok.mapped("country_department_id")
concerned = self.filtered(
lambda rp: rp.ffck_network
and int(rp.partner_scale) >= 4

Loading…
Cancel
Save