From 5cd6d303b89ff6a5940ae4362525dd40b6c15a2f Mon Sep 17 00:00:00 2001 From: miguelpadin Date: Wed, 15 May 2024 10:34:11 +0100 Subject: [PATCH] [FIX] pms-api-rest-ocr: fix issue ocr --- pms_ocr_klippa/models/pms_property.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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])] )