We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb23eba commit 97a66c3Copy full SHA for 97a66c3
product_catalog_tree/models/product_catalog_mixin.py
@@ -11,4 +11,9 @@ def action_add_from_catalog(self):
11
search_view_id = self.env.ref("product.product_search_form_view").id
12
action["views"] = [(tree_view_id, "list")] + action["views"]
13
action["search_view_id"] = (search_view_id, "search")
14
+ # add warehouse location filter if order has warehouse
15
+ context = action.get("context", {})
16
+ if "order_id" in context and self._name == "sale.order":
17
+ if self._fields.get("warehouse_id") and self.warehouse_id:
18
+ action["context"]["search_default_location_id"] = self.warehouse_id.lot_stock_id.id
19
return action
0 commit comments