From 56289970f31d02cb24b16286a7ba8edb934aed4c Mon Sep 17 00:00:00 2001 From: houssine Date: Wed, 7 Mar 2018 10:32:51 +0100 Subject: [PATCH] [FIX] add condition is_company when handling the company representative --- easy_my_coop/wizard/create_subscription_from_partner.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/easy_my_coop/wizard/create_subscription_from_partner.py b/easy_my_coop/wizard/create_subscription_from_partner.py index eb64606..1ecf669 100644 --- a/easy_my_coop/wizard/create_subscription_from_partner.py +++ b/easy_my_coop/wizard/create_subscription_from_partner.py @@ -147,9 +147,11 @@ class PartnerCreateSubscription(models.TransientModel): if self.check_belgian_ident_id(self.register_number): coop_vals['national_register_number'] = self.register_number - if not self._get_representative(): - representative_number = self.representative_number - representative = partner_obj.search([('national_register_number','=',representative_number)]) + if self.is_company and not self._get_representative(): + representative = False + if self.representative_number: + representative_number = self.representative_number + representative = partner_obj.search([('national_register_number','=',representative_number)]) if representative: if len(representative) > 1: