[update] modification activity_federation en Many2many

parent 3c006a92
......@@ -219,16 +219,20 @@ class ScopPartner(models.Model):
compute='_compute_federation',
store=True,
default=False)
activity_federation_com = fields.Many2one(
activity_federation_com_ids = fields.Many2many(
comodel_name='scop.federation.com.activity',
string="Domaine d'activité",
help="Fédération de la Com - Domaine d'activité",
ondelete="set null")
activity_federation_indus = fields.Many2one(
relation='res_partner_federation_com_activity_rel',
column1='partner_id',
column2='com_activity_id',
string="Domaine d'activité Com",
help="Fédération de la Com - Domaine d'activité")
activity_federation_indus_ids = fields.Many2many(
comodel_name='scop.federation.indus.activity',
string="Domaine d'activité",
help="Fédération de l'Industrie - Domaine d'activité",
ondelete="set null")
relation='res_partner_federation_indus_activity_rel',
column1='partner_id',
column2='indus_activity_id',
string="Domaine d'activité Industrie",
help="Fédération de l'Industrie - Domaine d'activité")
# Contacts
director_ids = fields.One2many(
......
......@@ -10,6 +10,13 @@ class ScopFederationComActivity(models.Model):
_order = "name"
name = fields.Char("Domaine d'activité", required=True)
partner_ids = fields.Many2many(
comodel_name='res.partner',
relation='res_partner_federation_com_activity_rel',
column1='com_activity_id',
column2='partner_id',
string="Cooperatives",
domain=[('is_cooperative', '=', True)])
class ScopFederationIndusActivity(models.Model):
......@@ -18,3 +25,10 @@ class ScopFederationIndusActivity(models.Model):
_order = "name"
name = fields.Char("Domaine d'activité", required=True,)
partner_ids = fields.Many2many(
comodel_name='res.partner',
relation='res_partner_federation_indus_activity_rel',
column1='indus_activity_id',
column2='partner_id',
string="Cooperatives",
domain=[('is_cooperative', '=', True)])
......@@ -364,8 +364,10 @@
<field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]" attrs="{'invisible': [('project_status', 'in', ('1_information'))]}"/>
<field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]" attrs="{'invisible': [('project_status', 'in', ('1_information'))]}"/>
<field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]" attrs="{'invisible': [('project_status', 'in', ('1_information'))]}"/>
<field name="activity_federation_com" groups="cgscop_partner.group_federation_com" options="{'no_open': True, 'no_create': True}"/>
<field name="activity_federation_indus" groups="cgscop_partner.group_federation_indus" options="{'no_open': True, 'no_create': True}"/>
<field name="is_federation_com" invisible="True"/>
<field name="is_federation_indus" invisible="True"/>
<field name="activity_federation_com_ids" groups="cgscop_partner.group_federation_com" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('is_federation_com', '!=', True)]}" widget="many2many_tags"/>
<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}"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment