mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[14.0][IMP] stock_request_purchase: Use _for_xml_id for actions
This commit is contained in:
committed by
Jesús Alan Ramos Rodríguez
parent
e043130b8e
commit
303d98cc8f
@@ -26,7 +26,9 @@ class PurchaseOrder(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:
|
||||
|
||||
@@ -39,7 +39,7 @@ class StockRequest(models.Model):
|
||||
)
|
||||
|
||||
def action_view_purchase(self):
|
||||
action = self.env.ref("purchase.purchase_rfq").read()[0]
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id("purchase.purchase_rfq")
|
||||
|
||||
purchases = self.mapped("purchase_ids")
|
||||
if len(purchases) > 1:
|
||||
|
||||
@@ -30,7 +30,7 @@ class StockRequestOrder(models.Model):
|
||||
req.purchase_count = len(req.purchase_ids)
|
||||
|
||||
def action_view_purchase(self):
|
||||
action = self.env.ref("purchase.purchase_rfq").read()[0]
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id("purchase.purchase_rfq")
|
||||
purchases = self.mapped("purchase_ids")
|
||||
if len(purchases) > 1:
|
||||
action["domain"] = [("id", "in", purchases.ids)]
|
||||
|
||||
Reference in New Issue
Block a user