[FIX] pms-api-rest-ocr: fix issue ocr

This commit is contained in:
miguelpadin
2024-05-15 10:34:11 +01:00
committed by Darío Lodeiros
parent b38fce9ef9
commit 5cd6d303b8

View File

@@ -223,7 +223,7 @@ class PmsProperty(models.Model):
value["province"],
self.env["res.country.state"].search(domain).mapped("name"),
)
if candidates[1] >= 90:
if candidates and candidates[1] >= 90:
country_state = self.env["res.country.state"].search(
domain + [("name", "=", candidates[0])]
)