Browse Source

[IMP] l10n_fr_association

16.0
RemiFr82 6 months ago
parent
commit
4b162d022f
  1. 1
      l10n_fr_association/__init__.py
  2. 3
      l10n_fr_association/__manifest__.py
  3. 186
      l10n_fr_association/i18n/fr.po
  4. 1
      l10n_fr_association/models/__init__.py
  5. 128
      l10n_fr_association/models/res_partner.py
  6. 55
      l10n_fr_association/views/res_partner.xml

1
l10n_fr_association/__init__.py

@ -1 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

3
l10n_fr_association/__manifest__.py

@ -15,6 +15,9 @@
"category": "Human Resources",
"depends": [
"base",
"contacts",
"l10n_fr",
"l10n_fr_department_state",
],
"data": [
"views/res_partner.xml",

186
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-03-15 13:54+0000\n"
"PO-Revision-Date: 2024-03-15 13:54+0000\n"
"POT-Creation-Date: 2024-05-26 14:32+0000\n"
"PO-Revision-Date: 2024-05-26 14:32+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -17,8 +17,49 @@ msgstr ""
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Association info"
msgstr "Infos association"
msgid "ANR number"
msgstr "Numéro RNA"
#. 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
msgid "Assocation project"
msgstr "Projet associatif"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__asso_project_filename
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__asso_project_filename
msgid "Assocation project filename"
msgstr "Nom fichier Projet Asso"
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Association"
msgstr ""
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__company_registry_date
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__company_registry_date
msgid "Association National Register declaration date"
msgstr "Date d'enregistrement au Registre National des Associations"
#. 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__constituent_ga_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__constituent_ga_date
msgid "Consitutent GA"
msgstr "AG Constitutive"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__constituent_ga_date
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__constituent_ga_date
msgid "Constituent General Assembly date"
msgstr "Date de l'Assemblée Générale Constitutive"
#. module: l10n_fr_association
#: model:ir.model,name:l10n_fr_association.model_res_partner
@ -26,21 +67,50 @@ msgid "Contact"
msgstr ""
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__asso_create_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__asso_create_date
msgid "Creation date"
msgstr "Date de création"
#: 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_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Foundation"
msgstr "Fondation"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__is_french
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__is_french
msgid "French partner"
msgstr "Partenaire français"
#. 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
msgid "Internal Regul update"
msgstr "Màj du règlement intérieur"
msgid "Internal Reg. update"
msgstr "Màj du Règl. Int."
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__internal_regul_file
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__internal_regul_file
msgid "Internal Regulations file"
msgstr "Règlement Intérieur"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__internal_regul_filename
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__internal_regul_filename
msgid "Internal Regulations filename"
msgstr "Nom du fichier RI"
#. module: l10n_fr_association
#: model_terms:ir.ui.view,arch_db:l10n_fr_association.view_partner_form_inherit_base
msgid "Internal documents"
msgstr Documents internes"
msgstr "Documents internes"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__association
msgid "Is an association"
msgstr "Association"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__last_ga_date
@ -59,23 +129,107 @@ msgid "Legal information"
msgstr "Informations légales"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__internal_regul_file
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__naf_ape
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__naf_ape
msgid "NAF/APE code"
msgstr "Code NAF/APE"
#. 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
msgid "OJ department"
msgstr "Département du JO"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__official_journal
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__official_journal
msgid "OJ reference"
msgstr "Référence du JO"
#. 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
msgid "Official Journal"
msgstr "Journal Officiel du"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__official_journal_date
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__official_journal_date
msgid "Official Journal publication date"
msgstr "Date de publication au Journal Officiel"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__official_journal_dept_id
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__official_journal_dept_id
msgid "Official Journal publication department"
msgstr "Département de publication au Journal Officiel"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__official_journal
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__official_journal
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__prefecture
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__prefecture
msgid "Prefecture"
msgstr "Préfecture"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__prefecture
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__prefecture
msgid "Prefecture (city) of declaration"
msgstr "Préfecture (ville) de déclaration"
#. module: l10n_fr_association
#: model:ir.model.fields,help:l10n_fr_association.field_res_partner__prefecture_date
#: model:ir.model.fields,help:l10n_fr_association.field_res_users__prefecture_date
msgid "Prefecture declaration date"
msgstr "Date de déclaration en préfecture"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__asso_project_update_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__asso_project_update_date
msgid "Project update"
msgstr "Màj du Projet"
#. 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
msgid "Registration date"
msgstr "Date d'enregistrement"
#. module: l10n_fr_association
#: 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: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__internal_regul_file
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__statuses_file
msgid "Statuses file"
msgstr "Statuts"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__internal_regul_filename
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__statuses_filename
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__internal_regul_filename
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__statuses_filename
msgid "Statuses filename"
msgstr "Nom du fichier statuts"
msgstr "Nom du fichier Statuts"
#. module: l10n_fr_association
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_partner__statuses_update_date
#: model:ir.model.fields,field_description:l10n_fr_association.field_res_users__statuses_update_date
msgid "Statuses update"
msgstr "Màj des statuts"
#. 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
msgid ""
"The registry number of the company. Use it if it is different from the Tax "
"ID. It must be unique across all partners of a same country"
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"

1
l10n_fr_association/models/__init__.py

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

128
l10n_fr_association/models/res_partner.py

@ -1,17 +1,129 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
from odoo import models, fields, api
class ResPartner(models.Model):
_inherit = "res.partner"
# Important dates
asso_create_date = fields.Date(string="Creation date", tracking="80")
association = fields.Boolean(string="Is an association")
is_french = fields.Boolean(
string="French partner", compute="partner_is_french", store=True
)
constituent_ga_date = fields.Date(
string="Consitutent GA",
tracking="80",
help="Constituent General Assembly date",
)
prefecture_date = fields.Date(
string="Declaration date",
tracking="82",
help="Prefecture declaration date",
)
prefecture = fields.Char(
string="Prefecture",
tracking="81",
help="Prefecture (city) of declaration",
)
official_journal_date = fields.Date(
string="Official Journal",
tracking="83",
help="Official Journal publication date",
)
official_journal_dept_id = fields.Many2one(
comodel_name="res.country.department",
string="OJ department",
tracking="81",
help="Official Journal publication department",
domain=[
(
"country_id.code",
"in",
(
"FR",
"GP",
"MQ",
"GF",
"RE",
"YT",
),
)
],
)
official_journal = fields.Char(
string="OJ reference",
tracking="81",
help="Official Journal reference",
)
company_registry_date = fields.Date(
string="Registration date",
help="Association National Register declaration date",
tracking="83",
)
company_registry = fields.Char(tracking="83")
naf_ape = fields.Char(string="NAF/APE code", tracking="83")
last_ga_date = fields.Date(string="Last general assembly", tracking="81")
# Documents fields
statuses_file = fields.Binary("Statuses file", tracking="82")
statuses_filename = fields.Char("Statuses filename")
statuses_file = fields.Binary("Statuses file")
statuses_filename = fields.Char("Statuses filename", tracking="83")
statuses_update_date = fields.Date("Statuses update", tracking="83")
internal_regul_file = fields.Binary("Statuses file", tracking="84")
internal_regul_filename = fields.Char("Statuses filename")
internal_regul_update_date = fields.Date("Internal Regul update", tracking="85")
internal_regul_file = fields.Binary("Internal Regulations file")
internal_regul_filename = fields.Char(
"Internal Regulations filename", tracking="83"
)
internal_regul_update_date = fields.Date("Internal Reg. update", tracking="85")
asso_project_file = fields.Binary("Assocation project")
asso_project_filename = fields.Char("Assocation project filename", tracking="83")
asso_project_update_date = fields.Date("Project update", tracking="83")
@api.depends("country_id")
def partner_is_french(self):
for partner in self:
partner.is_french = partner.country_id and partner.country_id.code in (
"FR",
"GP",
"MQ",
"GF",
"RE",
"YT",
)
@api.onchange("is_company", "country_id")
def onchange_asso_is_french_company(self):
if self.association and (not self.is_company or not self.is_french):
self.association = False
# @api.onchange("association")
# def onchange_association(self):
# if not self.association:
# values = {}
# if self.statuses_file:
# values.update(
# {
# "statuses_file": False,
# "statuses_filename": False,
# "statuses_update_date": False,
# }
# )
# if self.internal_regul_file:
# values.update(
# {
# "internal_regul_file": False,
# "internal_regul_filename": False,
# "internal_regul_update_date": False,
# }
# )
# for field in [
# "association",
# "asso_creation_date",
# "prefecture_date",
# "prefecture",
# "official_journal_date",
# "company_registry_date",
# "company_registry",
# "naf_ape",
# "last_ga_date",
# ]:
# if getattr(self, field) != False:
# values.update({field: False})
# if values:
# self.update(values)

55
l10n_fr_association/views/res_partner.xml

@ -6,14 +6,42 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="is_company" position="after">
<field name="is_french" invisible="1" />
</field>
<field name="company_type" position="after">
<field name="association" attrs="{'invisible': ['|',('is_company','!=',True),('is_french','!=',True)]}" />
<label for="association" attrs="{'invisible': ['|',('is_company','!=',True),('is_french','!=',True)]}" />
</field>
<field name="company_registry" position="attributes">
<attribute name="attrs">{'invisible': ['|',('is_company','=',False),('association','=',True)]}</attribute>
</field>
<field name="company_registry" position="after">
<field name="company_registry_date"
attrs="{'invisible': ['|',('is_company','=',False),('association','=',True)]}" />
</field>
<field name="ref" position="attributes">
<attribute name="attrs">{'invisible': [('association','=',True)]}</attribute>
</field>
<xpath expr="//notebook/page[1]" position="after">
<page name="asso_info" string="Association info" attrs="{'invisible': [('is_company','=',False)]}">
<group name="life_main">
<group name="legal_info" string="Legal information">
<field name="asso_create_date" />
<page name="asso" string="Association" attrs="{'invisible': [('association','=',False)]}">
<group name="asso_main" col="3">
<group name="foundation" string="Foundation" class="o_label_nowrap">
<field name="constituent_ga_date" />
<field name="prefecture_date" />
<field name="prefecture" />
<field name="official_journal_date" />
<field name="official_journal_dept_id" widget="selection" />
<field name="official_journal" />
</group>
<group name="legal_info" string="Legal information" class="o_label_nowrap">
<field name="ref" string="Short name" />
<field name="company_registry" string="ANR number" />
<field name="company_registry_date" />
<field name="naf_ape" />
<field name="last_ga_date" />
</group>
<group name="documents" string="Legal documents">
<group name="documents" string="Legal documents" class="o_label_nowrap">
<field name="statuses_file" filename="statuses_filename" />
<field name="statuses_filename" invisible="1" />
<field name="statuses_update_date" />
@ -21,6 +49,9 @@
<field name="internal_regul_file" filename="internal_regulations_filename" />
<field name="internal_regul_filename" invisible="1" />
<field name="internal_regul_update_date" />
<field name="asso_project_file" filename="asso_projectations_filename" />
<field name="asso_project_filename" invisible="1" />
<field name="asso_project_update_date" />
</group>
</group>
</page>
@ -28,4 +59,18 @@
</field>
</record>
<record id="res_partner_form_l10n_fr_inherit" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="l10n_fr.res_partner_form_l10n_fr" />
<field name="arch" type="xml">
<field name="siret" position="attributes">
<attribute name="attrs">{'invisible': ['|',('is_company','=',False),('association','=',True)]}</attribute>
</field>
<xpath expr="//group[@name='legal_info']/field[@name='company_registry_date']" position="after">
<field name="siret" />
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save