From e4015e27de8ee6c0d14f37ad85c6f3cbe1e4bd29 Mon Sep 17 00:00:00 2001 From: EdgarRetes Date: Tue, 26 Nov 2024 16:45:36 -0600 Subject: [PATCH] [FIX] threshold create --- kpi/models/kpi_threshold.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpi/models/kpi_threshold.py b/kpi/models/kpi_threshold.py index f4a492c0e4..53d94c0b70 100644 --- a/kpi/models/kpi_threshold.py +++ b/kpi/models/kpi_threshold.py @@ -61,7 +61,7 @@ def create(self, data): # TODO: This code can be done better range_obj1 = self.env["kpi.threshold.range"] range_obj2 = self.env["kpi.threshold.range"] - if data.get("range_ids"): + if data.get("range_ids") and data["range_ids"][0][2]: for range1 in data["range_ids"][0][2]: range_obj1 = range_obj1.browse(range1) for range2 in data["range_ids"][0][2]: