chore: Se usa if guard para romper flujo en caso de nulo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Camilo Gonzalez 2023-08-11 17:22:49 -05:00
parent 55b7aada89
commit b63f0ffd85

View File

@ -41,12 +41,13 @@ class ProspectTrace(ModelSQL, ModelView):
@fields.depends('prospect')
def on_change_prospect(self):
if self.prospect:
self.prospect_city = self.prospect.city
if not self.prospect:
return
mobile_contact = self._get_prospect_mobile_contact()
if mobile_contact:
self.prospect_contact = mobile_contact
self.prospect_city = self.prospect.city
mobile_contact = self._get_prospect_mobile_contact()
if mobile_contact:
self.prospect_contact = mobile_contact
def get_rec_name(self, name):
if self.prospect: