diff --git a/pms_ocr_klippa/models/pms_property.py b/pms_ocr_klippa/models/pms_property.py index cf80bbed4..04c273933 100644 --- a/pms_ocr_klippa/models/pms_property.py +++ b/pms_ocr_klippa/models/pms_property.py @@ -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])] )