Browse Source

[IMP] l10n_fr_association

16.0
RemiFr82 7 months ago
parent
commit
dc2a13fcd5
  1. 9
      l10n_fr_association/__manifest__.py
  2. 37
      l10n_fr_association/data/res_partner_relation_instance.xml
  3. 8
      l10n_fr_association/data/res_partner_relation_type.xml
  4. 195
      l10n_fr_association/i18n/fr.po
  5. 2
      l10n_fr_association/models/__init__.py
  6. 68
      l10n_fr_association/models/res_partner_relation_instance.py
  7. 28
      l10n_fr_association/models/res_partner_relation_type.py
  8. 3
      l10n_fr_association/security/ir.model.access.csv
  9. 19
      l10n_fr_association/security/ir_rule.xml
  10. 15
      l10n_fr_association/security/res_groups.xml
  11. 11
      l10n_fr_association/views/res_partner.xml
  12. 64
      l10n_fr_association/views/res_partner_relation_instance.xml
  13. 50
      l10n_fr_association/views/res_partner_relation_type.xml

9
l10n_fr_association/__manifest__.py

@ -18,9 +18,18 @@
"contacts",
"l10n_fr",
"l10n_fr_department_state",
"partner_multi_relation",
],
"data": [
# Base data
"data/res_partner_relation_instance.xml",
# "data/res_partner_relation_type.xml",
# Security
"security/ir.model.access.csv",
# Views
"views/res_partner.xml",
"views/res_partner_relation_instance.xml",
"views/res_partner_relation_type.xml",
],
"assets": {},
"demo": [],

37
l10n_fr_association/data/res_partner_relation_instance.xml

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="relation_insctance_councile" model="res.partner.relation.instance">
<field name="name">Councile</field>
<field name="short">Coun.</field>
<field name="inst_type">adm</field>
</record>
<record id="relation_insctance_office" model="res.partner.relation.instance">
<field name="name">Office</field>
<field name="short">Offi.</field>
<field name="inst_type">adm</field>
<field name="parent_id" ref="relation_insctance_councile" />
</record>
<record id="relation_insctance_sup_staff" model="res.partner.relation.instance">
<field name="name">Supervision staff</field>
<field name="short">Staff</field>
<field name="inst_type">sup</field>
</record>
<record id="relation_insctance_sup_vol" model="res.partner.relation.instance">
<field name="name">Volunteer supervision</field>
<field name="short">Volu.</field>
<field name="inst_type">sup</field>
<field name="parent_id" ref="relation_insctance_sup_staff" />
</record>
<record id="relation_insctance_sup_emp" model="res.partner.relation.instance">
<field name="name">Employed supervision</field>
<field name="short">Empl.</field>
<field name="inst_type">sup</field>
<field name="parent_id" ref="relation_insctance_sup_staff" />
</record>
</odoo>

8
l10n_fr_association/data/res_partner_relation_type.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="relation_type_president" model="res.partner.relation.type">
<field name="name">President</field>
</record>
</odoo>

195
l10n_fr_association/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 14:32+0000\n"
"PO-Revision-Date: 2024-05-26 14:32+0000\n"
"POT-Creation-Date: 2024-05-26 22:57+0000\n"
"PO-Revision-Date: 2024-05-26 22:57+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -20,6 +20,16 @@ msgstr ""
msgid "ANR number"
msgstr "Numéro RNA"
#. module: l10n_fr_association
#: model:ir.model.fields.selection,name:l10n_fr_association.selection__res_partner_relation_instance__inst_type__adm
msgid "Administration"
msgstr ""
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_type__insctance_id
msgid "Asso instance"
msgstr "Instance asso."
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__asso_project_file
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__asso_project_file
@ -43,12 +53,22 @@ msgstr ""
msgid "Association National Register declaration date"
msgstr "Date d'enregistrement au Registre National des Associations"
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_res_partner_filter_inherit_base
msgid "Associations"
msgstr ""
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__company_registry
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__company_registry
msgid "Company ID"
msgstr "ID de la société"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__child_ids
msgid "Composing instances"
msgstr "Composé des instances"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__constituent_ga_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__constituent_ga_date
@ -66,12 +86,59 @@ msgstr "Date de l'Assemblée Générale Constitutive"
msgid "Contact"
msgstr ""
#. module: l10n_fr_association
#: model:res.partner.relation.instance,short:l10n_fr_association.relation_insctance_councile
msgid "Coun."
msgstr "C.A."
#. module: l10n_fr_association
#: model:res.partner.relation.instance,name:l10n_fr_association.relation_insctance_councile
msgid "Councile"
msgstr "Conseil d'Administration"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__create_date
msgid "Created on"
msgstr "Créé le"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__prefecture_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__prefecture_date
msgid "Declaration date"
msgstr "Date de déclaration"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__display_name
msgid "Display Name"
msgstr "Nom d'affichange"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,short:l10n_fr_association.relation_insctance_sup_emp
msgid "Empl."
msgstr "Pro."
#. module: l10n_fr_association
#: model:res.partner.relation.instance,name:l10n_fr_association.relation_insctance_sup_emp
msgid "Employed supervision"
msgstr "Encadrement professionnel"
#. module: l10n_fr_association
#: model:ir.model.fields.selection,name:l10n_fr_association.selection__res_partner_relation_type__relation_type__1
msgid "Employee"
msgstr "Employé"
#. module: l10n_fr_association
#. odoo-python
#: code:addons/l10n_fr_association/models/res_partner_relation_instance.py:0
#, python-format
msgid "Error ! You cannot create recursive instances."
msgstr "Erreur ! vous ne pouvez pas créer des instances recursives."
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Foundation"
@ -83,6 +150,27 @@ msgstr "Fondation"
msgid "French partner"
msgstr "Partenaire français"
#. module: l10n_fr_association
#: model:ir.model.fields.selection,name:l10n_fr_association.selection__res_partner_relation_instance__inst_type__ag
msgid "General Assembly"
msgstr "Asemblée Ganérale"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__id
msgid "ID"
msgstr ""
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.res_partner_relation_type_view_search
msgid "Instance"
msgstr ""
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__inst_type
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.res_partner_relation_instance_view_search
msgid "Instance type"
msgstr "Type d'instance"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__internal_regul_update_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__internal_regul_update_date
@ -112,6 +200,21 @@ msgstr "Documents internes"
msgid "Is an association"
msgstr "Association"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__write_uid
msgid "Last Updated by"
msgstr "Dernière modification par"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__last_ga_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__last_ga_date
@ -134,6 +237,11 @@ msgstr "Informations légales"
msgid "NAF/APE code"
msgstr "Code NAF/APE"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__name
msgid "Name"
msgstr "Nom"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__official_journal_dept_id
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__official_journal_dept_id
@ -146,6 +254,16 @@ msgstr "Département du JO"
msgid "OJ reference"
msgstr "Référence du JO"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,short:l10n_fr_association.relation_insctance_office
msgid "Offi."
msgstr "Bur."
#. module: l10n_fr_association
#: model:res.partner.relation.instance,name:l10n_fr_association.relation_insctance_office
msgid "Office"
msgstr "Bureau"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__official_journal_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__official_journal_date
@ -170,6 +288,26 @@ msgstr "Département de publication au Journal Officiel"
msgid "Official Journal reference"
msgstr "Numéro du Journal Officiel"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__parent_path
msgid "Parent Path"
msgstr "Chemin parent"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__parents_and_self
msgid "Parents And Self"
msgstr "Parents et instance"
#. module: l10n_fr_association
#: model:ir.model,name:l10n_fr_association.model_res_partner_relation_type
msgid "Partner Relation Type"
msgstr "Type de relation de partenaire"
#. module: l10n_fr_association
#: model:ir.model,name:l10n_fr_association.model_res_partner_relation_instance
msgid "Partners relation instance"
msgstr "Instance de relation de partenaire"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__prefecture
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__prefecture
@ -194,6 +332,11 @@ msgstr "Date de déclaration en préfecture"
msgid "Project update"
msgstr "Màj du Projet"
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.form_res_partner_relation_type_inherit_ffck
msgid "Properties"
msgstr "Propriétés"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__company_registry_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__company_registry_date
@ -201,10 +344,28 @@ msgid "Registration date"
msgstr "Date d'enregistrement"
#. module: l10n_fr_association
#: model:ir.actions.act_window,name:l10n_fr_association.relation_instance_action
#: model:ir.ui.menu,name:l10n_fr_association.relation_instance_menu
msgid "Relation instances"
msgstr "Instances de relation"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_type__relation_type
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.res_partner_relation_type_view_search
msgid "Relation type"
msgstr "Type de relation"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__short
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Short name"
msgstr "Initiales"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,short:l10n_fr_association.relation_insctance_sup_staff
msgid "Staff"
msgstr "Enc."
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__statuses_file
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__statuses_file
@ -223,6 +384,21 @@ msgstr "Nom du fichier Statuts"
msgid "Statuses update"
msgstr "Màj des statuts"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner_relation_instance__parent_id
msgid "Superior instance"
msgstr "Instance supérieure"
#. module: l10n_fr_association
#: model:ir.model.fields.selection,name:l10n_fr_association.selection__res_partner_relation_instance__inst_type__sup
msgid "Supervision"
msgstr "Encadrement"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,name:l10n_fr_association.relation_insctance_sup_staff
msgid "Supervision staff"
msgstr "Équipe pédagogique"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__company_registry
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__company_registry
@ -233,3 +409,18 @@ msgstr ""
"Le numéro de registre de la société. Utilisez-le s'il est différent du "
"numéro d'identification fiscale. Il doit être unique parmi tous les "
"partenaires d'un même pays"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,short:l10n_fr_association.relation_insctance_sup_vol
msgid "Volu."
msgstr "Bén."
#. module: l10n_fr_association
#: model:ir.model.fields.selection,name:l10n_fr_association.selection__res_partner_relation_type__relation_type__0
msgid "Volunteer"
msgstr "Bénévole"
#. module: l10n_fr_association
#: model:res.partner.relation.instance,name:l10n_fr_association.relation_insctance_sup_vol
msgid "Volunteer supervision"
msgstr "Encadrement bénévole"

2
l10n_fr_association/models/__init__.py

@ -1,2 +1,4 @@
# -*- coding: utf-8 -*-
from . import res_partner_relation_instance
from . import res_partner_relation_type
from . import res_partner

68
l10n_fr_association/models/res_partner_relation_instance.py

@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
TYPES = [
("adm", "Administration"),
("sup", "Supervision"),
("ag", "General Assembly"),
]
class ResPartnerRelationInsctance(models.Model):
_name = "res.partner.relation.instance"
_description = "Partners relation instance"
_order = "inst_type, short, name, id"
name = fields.Char(
string="Name",
translate=True,
required=True,
)
short = fields.Char(
string="Short name",
translate=True,
required=True,
)
inst_type = fields.Selection(
selection=TYPES,
string="Instance type",
required=True,
)
parent_id = fields.Many2one(
comodel_name="res.partner.relation.instance",
string="Superior instance",
)
parent_path = fields.Char(
unaccent=False,
)
parents_and_self = fields.Many2many(
comodel_name="res.partner.relation.instance",
compute="_compute_parents_and_self",
)
child_ids = fields.One2many(
comodel_name="res.partner.relation.instance",
inverse_name="parent_id",
string="Composing instances",
)
def name_get(self):
res = []
for instance in self:
res.append(
(instance.id, " / ".join(instance.parents_and_self.mapped("name")))
)
return res
def _compute_parents_and_self(self):
for instance in self:
if instance.parent_path:
instance.parents_and_self = self.env[self._model].browse(
[int(p) for p in instance.parent_path.split("/")[:-1]]
)
else:
instance.parents_and_self = instance
@api.constrains("parent_id")
def check_parent_id(self):
if not self._check_recursion():
raise ValueError(_("Error ! You cannot create recursive instances."))

28
l10n_fr_association/models/res_partner_relation_type.py

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
INSTANCES = [
("1", "Office"),
("2", "Councile"),
("3", "Commission"),
("4", "Supervision"),
("5", "Active member"),
]
TYPES = [
("0", "Volunteer"),
("1", "Employee"),
]
class ResPartnerRelationType(models.Model):
_inherit = "res.partner.relation.type"
insctance_id = fields.Many2one(
comodel_name="res.partner.relation.instance",
string="Asso instance",
)
relation_type = fields.Selection(
selection=TYPES,
string="Relation type",
)

3
l10n_fr_association/security/ir.model.access.csv

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_res_partner_relation_instance_all,All res.partner.relation.instance,model_res_partner_relation_instance,,1,0,0,0
access_res_partner_relation_instance_group_partner_manager,Partner manager res.partner.relation.instance,model_res_partner_relation_instance,base.group_system,1,1,1,0

19
l10n_fr_association/security/ir_rule.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- <data noupdate="1"> -->
<data>
<!-- ir.model -->
<!-- <record id="ir_rule_ir_model_res_group" model="ir.rule">
<field name="name"></field>
<field name="model_id" ref="module.model_ir_model" />
<field name="domain_force">[]</field>
<field name="groups" eval="[(4, ref('module.res_group'))]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="False" />
<field name="perm_unlink" eval="False" />
</record> -->
</data>
</odoo>

15
l10n_fr_association/security/res_groups.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- <record id="ir_module_category_application" model="ir.module.category">
<field name="name">Application</field>
<field name="sequence"></field>
</record> -->
<!-- <record id="res_group_name" model="res.groups">
<field name="name">Group name</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
<field name="category_id" ref="ir_module_category_proapn_membership" />
</record> -->
</odoo>

11
l10n_fr_association/views/res_partner.xml

@ -73,4 +73,15 @@
</field>
</record>
<record id="view_res_partner_filter_inherit_base" model="ir.ui.view">
<field name="name">res.partner.view.search.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<filter name="type_company" position="after">
<filter name="association" string="Associations" domain="[('association','=',True)]" />
</filter>
</field>
</record>
</odoo>

64
l10n_fr_association/views/res_partner_relation_instance.xml

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_partner_relation_instance_view_form" model="ir.ui.view">
<field name="name">res.partner.relation.instance.view.form</field>
<field name="model">res.partner.relation.instance</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_title">
<field name="name" />
</div>
<group col="6">
<field name="short" />
<field name="inst_type" />
<field name="parent_id" />
</group>
</sheet>
</form>
</field>
</record>
<record id="res_partner_relation_instance_view_tree" model="ir.ui.view">
<field name="name">res.partner.relation.instance.view.tree</field>
<field name="model">res.partner.relation.instance</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="short" />
<field name="inst_type" />
<field name="parent_id" />
</tree>
</field>
</record>
<record id="res_partner_relation_instance_view_search" model="ir.ui.view">
<field name="name">res.partner.relation.instance.view.search</field>
<field name="model">res.partner.relation.instance</field>
<field name="arch" type="xml">
<search>
<group expand="0" name="group_by">
<filter name="by_inst_type" string="Instance type" context="{'group_by':'inst_type'}" />
</group>
</search>
</field>
</record>
<record id="relation_instance_action" model="ir.actions.act_window">
<field name="name">Relation instances</field>
<field name="res_model">res.partner.relation.instance</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
<menuitem
id="relation_instance_menu"
name="Relation instances"
action="relation_instance_action"
groups="base.group_system"
parent="partner_multi_relation.menu_res_partner_relation"
sequence="20" />
</odoo>

50
l10n_fr_association/views/res_partner_relation_type.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="form_res_partner_relation_type_inherit_ffck" model="ir.ui.view">
<field name="name">res.partner.relation.type.view.form.inherit</field>
<field name="model">res.partner.relation.type</field>
<field name="inherit_id" ref="partner_multi_relation.form_res_partner_relation_type" />
<field name="arch" type="xml">
<group name="properties" position="replace">
<group name='properties' string="Properties">
<group>
<field name="allow_self" />
<field name="is_symmetric" />
<field name="handle_invalid_onchange" />
</group>
<group>
<field name="insctance_id" widget="selection" />
<field name="relation_type" />
</group>
</group>
</group>
</field>
</record>
<record id="tree_res_partner_relation_type_inherit_ffck" model="ir.ui.view">
<field name="name">res.partner.relation.type.view.tree.inherit</field>
<field name="model">res.partner.relation.type</field>
<field name="inherit_id" ref="partner_multi_relation.tree_res_partner_relation_type" />
<field name="arch" type="xml">
<field name="name" position="before">
<field name="insctance_id" widget="selection" />
<field name="relation_type" />
</field>
</field>
</record>
<record id="res_partner_relation_type_view_search" model="ir.ui.view">
<field name="name">res.partner.relation.type.view.search</field>
<field name="model">res.partner.relation.type</field>
<field name="arch" type="xml">
<search>
<group expand="0" name="group_by">
<filter name="by_instance" string="Instance" context="{'group_by':'insctance_id'}" />
<filter name="by_type" string="Relation type" context="{'group_by':'relation_type'}" />
</group>
</search>
</field>
</record>
</odoo>
Loading…
Cancel
Save