mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] adapt syntax for act_window lookup
This commit is contained in:
@@ -26,8 +26,9 @@ class StockPicking(models.Model):
|
||||
"""
|
||||
:return dict: dictionary value for created view
|
||||
"""
|
||||
action = self.env.ref("stock_request.action_stock_request_form").read()[0]
|
||||
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock_request.action_stock_request_form"
|
||||
)
|
||||
requests = self.mapped("stock_request_ids")
|
||||
if len(requests) > 1:
|
||||
action["domain"] = [("id", "in", requests.ids)]
|
||||
|
||||
@@ -348,8 +348,9 @@ class StockRequest(models.Model):
|
||||
return True
|
||||
|
||||
def action_view_transfer(self):
|
||||
action = self.env.ref("stock.action_picking_tree_all").read()[0]
|
||||
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock.action_picking_tree_all"
|
||||
)
|
||||
pickings = self.mapped("picking_ids")
|
||||
if len(pickings) > 1:
|
||||
action["domain"] = [("id", "in", pickings.ids)]
|
||||
|
||||
@@ -248,7 +248,9 @@ class StockRequestOrder(models.Model):
|
||||
return
|
||||
|
||||
def action_view_transfer(self):
|
||||
action = self.env.ref("stock.action_picking_tree_all").sudo().read()[0]
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock.action_picking_tree_all"
|
||||
)
|
||||
|
||||
pickings = self.mapped("picking_ids")
|
||||
if len(pickings) > 1:
|
||||
@@ -259,7 +261,9 @@ class StockRequestOrder(models.Model):
|
||||
return action
|
||||
|
||||
def action_view_stock_requests(self):
|
||||
action = self.env.ref("stock_request.action_stock_request_form").read()[0]
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock_request.action_stock_request_form"
|
||||
)
|
||||
if len(self.stock_request_ids) > 1:
|
||||
action["domain"] = [("order_id", "in", self.ids)]
|
||||
elif self.stock_request_ids:
|
||||
@@ -353,7 +357,9 @@ class StockRequestOrder(models.Model):
|
||||
"administrator."
|
||||
)
|
||||
)
|
||||
action = self.env.ref("stock_request.stock_request_order_action").read()[0]
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock_request.stock_request_order_action"
|
||||
)
|
||||
action["views"] = [
|
||||
(self.env.ref("stock_request.stock_request_order_form").id, "form")
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user