From 0ca62c888aba376e80832263b8c4ec66e5a1d061 Mon Sep 17 00:00:00 2001 From: Kaynnan Lemes Date: Tue, 2 Jul 2024 20:24:45 -0300 Subject: [PATCH] [FIX] stock_request: SR/SRO conflict where using tier.validation --- stock_request/models/stock_request_order.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stock_request/models/stock_request_order.py b/stock_request/models/stock_request_order.py index 7ae87e175223..10de0ff82390 100644 --- a/stock_request/models/stock_request_order.py +++ b/stock_request/models/stock_request_order.py @@ -151,13 +151,13 @@ def _compute_state(self): for item in self: states = item.stock_request_ids.mapped("state") if not item.stock_request_ids or all(x == "draft" for x in states): - item.state = "draft" + item.write({"state": "draft"}) elif all(x == "cancel" for x in states): - item.state = "cancel" + item.write({"state": "cancel"}) elif all(x in ("done", "cancel") for x in states): - item.state = "done" + item.write({"state": "done"}) else: - item.state = "open" + item.write({"state": "open"}) @api.depends("stock_request_ids.allocation_ids") def _compute_picking_ids(self):