From 2c9ecf6255f1b0ca76bc90f31f01a88cf0705461 Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Thu, 21 Nov 2024 12:50:27 +0100 Subject: [PATCH] [FIX] stock_cycle_count: use company of the location when creating cycle_count --- stock_cycle_count/models/stock_cycle_count_rule.py | 1 + stock_cycle_count/models/stock_warehouse.py | 1 + 2 files changed, 2 insertions(+) diff --git a/stock_cycle_count/models/stock_cycle_count_rule.py b/stock_cycle_count/models/stock_cycle_count_rule.py index e585f59a5e3c..06e2129d06da 100644 --- a/stock_cycle_count/models/stock_cycle_count_rule.py +++ b/stock_cycle_count/models/stock_cycle_count_rule.py @@ -160,6 +160,7 @@ def _propose_cycle_count(self, date, location): "date": fields.Datetime.from_string(date), "location": location, "rule_type": self, + "company_id": location.company_id, } return cycle_count diff --git a/stock_cycle_count/models/stock_warehouse.py b/stock_cycle_count/models/stock_warehouse.py index 469ed0ec7d05..4078af0005b2 100644 --- a/stock_cycle_count/models/stock_warehouse.py +++ b/stock_cycle_count/models/stock_warehouse.py @@ -74,6 +74,7 @@ def _prepare_cycle_count(self, cycle_count_proposed): "location_id": cycle_count_proposed["location"].id, "cycle_count_rule_id": cycle_count_proposed["rule_type"].id, "state": "draft", + "company_id": cycle_count_proposed["company_id"].id, } def action_compute_cycle_count_rules(self):