Browse Source

[IMP] do not return partner if company register number is None or empty

pull/98/head
houssine 5 years ago
parent
commit
55ecd83403
  1. 17
      easy_my_coop/models/partner.py

17
easy_my_coop/models/partner.py

@ -211,9 +211,14 @@ class ResPartner(models.Model):
) )
def get_cooperator_from_crn(self, company_register_number): def get_cooperator_from_crn(self, company_register_number):
return self.env["res.partner"].search(
[
("cooperator", "=", True),
("company_register_number", "=", company_register_number),
]
)
company_register_number = company_register_number.strip()
if company_register_number:
partner = self.env["res.partner"].search(
[
("cooperator", "=", True),
("company_register_number", "=", company_register_number),
]
)
else:
partner = None
return partner
Loading…
Cancel
Save