...
 
Commits (3)
......@@ -381,10 +381,10 @@
<field name="activity_federation_indus_ids" groups="cgscop_partner.group_federation_indus" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('is_federation_indus', '!=', True)]}" widget="many2many_tags"/>
</group>
<group string="Informations Activité">
<field name="creation_origin_id" attrs="{'required': [('is_cooperative', '=', True)]}" options="{'no_open': True, 'no_create': True}"/>
<field name="creation_origin_id" attrs="{'required': [('is_cooperative', '=', True), ('cooperative_form_id', '!=', %(cgscop_partner.form_noncooperative)d)]}" options="{'no_open': True, 'no_create': True}"/>
<field name="creation_suborigin_id" domain="[('parent_id', '=', creation_origin_id), ('child_ids', '=', False)]" options="{'no_open': True, 'no_create': True}"/>
<field name="is_ag_constitution" attrs="{'invisible': [('project_status', '!=', '3_accompagnement')]}"/>
<field name="date_1st_sign" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement')), ('is_ag_constitution', '!=', True)], 'required': ['|', ('project_status', 'in', ('4_adhesion', '5_cg', '6_suivi')), ('is_ag_constitution', '=', True), ('is_cooperative', '=', True)]}"/>
<field name="date_1st_sign" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement')), ('is_ag_constitution', '!=', True)], 'required': ['|', ('project_status', 'in', ('4_adhesion', '5_cg', '6_suivi')), ('is_ag_constitution', '=', True), ('is_cooperative', '=', True), ('cooperative_form_id', '!=', %(cgscop_partner.form_noncooperative)d)]}"/>
<field name="registration_date" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}"/>
<field name="social_object" attrs="{'required': [('is_cooperative', '=', True), ('project_status','in',('2_pre-diagnostic', '3_accompagnement','4_adhesion', '5_cg', '6_suivi'))]}"/>
<field name="naf_id" attrs="{'readonly': [('write_date', '!=', False), ('project_status', '=', '6_suivi')], 'required':['|', ('project_status','in',('4_adhesion', '5_cg'), '&amp;', ('write_date', '=', False), ('project_status', '=', '6_suivi'))], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}" options="{'no_open': True, 'no_create': True}"/>
......@@ -399,7 +399,7 @@
</div>
<field name="siren" readonly="1" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}"/>
<field name="capital" attrs="{'required':[('project_status','in',('4_adhesion', '5_cg', '6_suivi'))], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}" widget="monetary"/>
<field name="first_closeout" attrs="{'required':[('is_cooperative', '!=', False), ('project_status', 'in', ('4_adhesion', '5_cg', '6_suivi'))], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}"/>
<field name="first_closeout" attrs="{'required':[('is_cooperative', '!=', False), ('project_status', 'in', ('4_adhesion', '5_cg', '6_suivi')), ('cooperative_form_id', '!=', %(cgscop_partner.form_noncooperative)d)], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}"/>
<field name="closeout_month" attrs="{'required':[('project_status','in',('4_adhesion', '5_cg', '6_suivi'))], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}"/>
<field name="is_seed_scop" attrs="{'invisible': [('project_status', '=', '1_information')]}"/>
<field name="seed_end" attrs="{'invisible': [('is_seed_scop', '!=', True)], 'required':[('project_status','in',('4_adhesion', '5_cg', '6_suivi')),('is_seed_scop', '=', True)]}"/>
......@@ -803,7 +803,7 @@
</group>
<field name="subscription_ids">
<tree string="Subscriptions" editable="bottom">
<field name="newsletter_id"/>
<field name="newsletter_id" domain="[]"/>
<field name="consent"/>
</tree>
</field>
......
......@@ -220,7 +220,16 @@ class ScopPeriodWizard(models.TransientModel):
period_values.update(values)
self.env['scop.period'].create(period_values)
# Gestion du cas des non coopératives adhérentes
non_coop = self.env.ref('cgscop_partner.form_noncooperative')
if period.cooperative_form_id == non_coop:
partner_values.update({
'creation_origin_id': None,
'date_1st_sign': None,
'first_closeout': None
})
# Update partner
partner_values.update(values)
partner = self.env['res.partner'].browse(period.partner_id)
partner.write(partner_values)