Browse Source

[FIX] fix case where the representative wasn't yet in the system

pull/1/head
houssine 6 years ago
parent
commit
2130359982
  1. 3
      easy_my_coop/models/coop.py

3
easy_my_coop/models/coop.py

@ -320,7 +320,8 @@ class subscription_request(models.Model):
contact = False contact = False
if self.no_registre: if self.no_registre:
contact = partner_obj.search([('national_register_number','=',self.no_registre)]) contact = partner_obj.search([('national_register_number','=',self.no_registre)])
contact.type = 'representative'
if contact:
contact.type = 'representative'
if not contact: if not contact:
contact_vals = {'name':self.name, 'first_name':self.firstname, 'last_name': self.lastname, contact_vals = {'name':self.name, 'first_name':self.firstname, 'last_name': self.lastname,
'customer':False, 'is_company':False, 'cooperator':True, 'customer':False, 'is_company':False, 'cooperator':True,

Loading…
Cancel
Save