diff --git a/datas/res.partner.organization.type.csv b/datas/res.partner.organization.type.csv index 3471281b5f80de9f412bbcd7f46d3f30d0ada47d..3c804a4af57de617ce8ee32e060eec3644cb1b21 100644 --- a/datas/res.partner.organization.type.csv +++ b/datas/res.partner.organization.type.csv @@ -39,6 +39,7 @@ 511,5,16552,"Mouvement entreprises sociales" 512,5,14423,"Mutuelle" 513,5,14427,"UDES" +514,5,,"Incubateur" 6,,14962,"Autre personne morale" 601,6,14964,"Association" 602,6,14963,"Entreprise" @@ -74,3 +75,4 @@ 916,9,14823,"Pôle emploi" 917,9,11758,"Profession Juridique" 918,9,14412,"Syndicat de Salariés" +919,9,,"Banque" diff --git a/models/res_partner.py b/models/res_partner.py index d87a5108d8d5ae6a5c4c287c933365819c6fa30b..5e0047a650d1611c940e0bb1f7faae174a9e5a3b 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -150,7 +150,8 @@ class ScopPartner(models.Model): incubator_id = fields.Many2one( 'res.partner', string='Incubateur', - domain=[('is_company', '=', True)], + domain=[('is_company', '=', True), + ('organization_subtype_id.name', '=', 'Incubateur')], on_delete='restrict') prescriber_canal_id = fields.Many2one( 'res.partner.prescriber.canal', @@ -174,12 +175,14 @@ class ScopPartner(models.Model): bank_id = fields.Many2one( 'res.partner', string='Banque principale', - domain=[('is_company', '=', True)], + domain=[('is_company', '=', True), + ('organization_subtype_id.name', '=', 'Banque')], on_delete='restrict') bank2_id = fields.Many2one( 'res.partner', string='Banque secondaire', - domain=[('is_company', '=', True)], + domain=[('is_company', '=', True), + ('organization_subtype_id.name', '=', 'Banque')], on_delete='restrict') accountant_id = fields.Many2one( 'res.partner',