[FIX] Fix access right issues when using actions

This commit is contained in:
Sébastien Alix
2022-01-29 08:29:11 +01:00
committed by Marina Alapont
parent ecf1696396
commit 64c66e791c
2 changed files with 3 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Link Purchase Order to Subcontract Productions",
"version": "14.0.1.0.0",
"version": "14.0.1.0.1",
"category": "Manufacturing",
"license": "LGPL-3",
"author": "Quartile Limited, Odoo Community Association (OCA)",

View File

@@ -19,7 +19,8 @@ class PurchaseOrder(models.Model):
def action_view_mrp(self):
productions = self.subcontract_production_ids
action = self.env.ref("mrp.mrp_production_action").read()[0]
xmlid = "mrp.mrp_production_action"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
if len(productions) > 1:
action["domain"] = [("id", "in", productions.ids)]
elif len(productions) == 1: