Skip to content
Extraits de code Groupes Projets
Valider dcbd51bf rédigé par Hugo Trentesaux's avatar Hugo Trentesaux
Parcourir les fichiers

add dissolution date

parent 7bf147c9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -25,6 +25,7 @@ class ResPartner(models.Model):
# TODO import these dates
date_coop = fields.Date(string="Date d'inscription en coopérative")
date_registration = fields.Date(string="Date d'enregistrement de l'entreprise")
date_dissolution = fields.Date(string="Date de dissolution")
# Note : peut-être utiliser l10n-france/l10n_fr_siret_lookup
# en 18.0 qui gère la récupération des codes APE et forme juridique
......@@ -61,9 +62,9 @@ class ResPartner(models.Model):
],
)
first_join_date = fields.Date(
date_first_contract = fields.Date(
string="Date de première adhésion",
compute="_compute_first_join_date",
compute="_compute_date_first_contract",
store=True,
readonly=False,
)
......@@ -216,10 +217,10 @@ class ResPartner(models.Model):
# TODO: valider la fonction
@api.depends("contract_ids", "contract_ids.date_start")
def _compute_first_join_date(self):
def _compute_date_first_contract(self):
for partner in self:
if partner.contract_ids:
partner.first_join_date = partner.contract_ids.sorted("date_start")[
partner.date_first_contract = partner.contract_ids.sorted("date_start")[
0
].date_start
......
......@@ -101,6 +101,9 @@
name="cooperative_form_id"
invisible="not is_cooperative"
/>
<field name="date_coop"/>
<field name="date_registration"/>
<field name="date_dissolution"/>
</group>
</group>
<group>
......@@ -132,7 +135,7 @@
<separator />
<group>
<group>
<field name="first_join_date" />
<field name="date_first_contract" />
</group>
<group>
<field name="removal" />
......@@ -226,33 +229,41 @@
<field name="model">res.partner</field>
<field name="arch" type="xml">
<list multi_edit="1">
<!-- coop fields -->
<field name="complete_name" />
<field name="date_last_event" />
<field name="date_last_meeting" optional="hide" />
<field name="date_last_support" optional="hide" />
<field name="phone" optional="hide"/>
<field name="email" optional="hide"/>
<field name="siren" />
<field name="num_orga" />
<field name="city" optional="show" />
<field name="siren" optional="show"/>
<field name="date_coop" optional="hide"/>
<field name="date_registration" optional="hide"/>
<field name="date_dissolution" optional="hide"/>
<field name="ur_id" optional="show" />
<field name="state_id" optional="show" />
<!-- addresse -->
<field name="city" optional="hide" />
<field name="zip" optional="hide" />
<field name="state_id" string="Région" optional="show" />
<field name="country_id" optional="hide"/>
<field name="country_department_id" optional="hide"/>
<!-- -->
<field name="naf_id" optional="show" />
<field name="ccn_id" optional="show" />
<field name="meeting_count" optional="show"/>
<field name="support_count" optional="show"/>
<field name="contract_count" optional="show"/>
<field name="write_date" optional="hide" />
<field name="write_uid" optional="hide" />
<field name="is_cooperative" optional="show" />
<field name="is_member_cgscop" optional="show" />
<field name="is_member_sante" optional="show" />
<field name="is_member_unmi" optional="show" />
<field name="is_member_mutex" optional="show" />
<field name="first_join_date" optional="show" />
<field name="company_size" optional="show" />
<!-- mucs fields -->
<field name="num_orga" optional="show" />
<field name="meeting_count" optional="show"/>
<field name="support_count" optional="show"/>
<field name="contract_count" optional="show"/>
<field name="is_cooperative" optional="hide" />
<field name="is_member_cgscop" optional="hide" />
<field name="is_member_sante" optional="hide" />
<field name="is_member_unmi" optional="hide" />
<field name="is_member_mutex" optional="hide" />
<field name="date_first_contract" optional="show" />
<field name="date_last_event" optional="show"/>
<field name="date_last_meeting" optional="hide" />
<field name="date_last_support" optional="hide" />
<field
name="category_id"
optional="hide"
......@@ -343,8 +354,8 @@
<separator />
<filter
string="Date de première adhésion"
name="first_join_date"
date="first_join_date"
name="date_first_contract"
date="date_first_contract"
/>
<separator />
<filter
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter