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):