From a805cdcb0e183a9071586d1ba43a91277046f90e Mon Sep 17 00:00:00 2001 From: houssine Date: Wed, 6 Jun 2018 15:37:36 +0200 Subject: [PATCH] [FIX] quick fix for non belgian localization(we should not take the national number into account --- easy_my_coop/models/coop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/models/coop.py b/easy_my_coop/models/coop.py index dca5197..c44e2d0 100644 --- a/easy_my_coop/models/coop.py +++ b/easy_my_coop/models/coop.py @@ -309,7 +309,9 @@ class subscription_request(models.Model): partner = partner[0] if self.is_company and not partner.has_representative(): - contact = partner_obj.search([('national_register_number','=',self.no_registre)]) + contact = False + if self.no_registre: + contact = partner_obj.search([('national_register_number','=',self.no_registre)]) if not contact: contact_vals = {'name':self.name, 'first_name':self.firstname, 'last_name': self.lastname, 'customer':False, 'is_company':False, 'cooperator':True,