From dff4e47cf51a17cfce9b487586428a76a12b88df Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 14 Apr 2021 08:13:53 +0200 Subject: [PATCH] Add sudo() to access ir.actions.act_windows... stupid v14! --- stock_usability/models/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_usability/models/product.py b/stock_usability/models/product.py index 14d1046..ed80662 100644 --- a/stock_usability/models/product.py +++ b/stock_usability/models/product.py @@ -15,7 +15,7 @@ class ProductTemplate(models.Model): type = fields.Selection(default='product') def action_view_stock_move(self): - action = self.env.ref('stock.stock_move_action').read()[0] + action = self.env.ref('stock.stock_move_action').sudo().read()[0] action['domain'] = [('product_id.product_tmpl_id', 'in', self.ids)] action['context'] = {'search_default_done': True} return action @@ -25,7 +25,7 @@ class ProductProduct(models.Model): _inherit = 'product.product' def action_view_stock_move(self): - action = self.env.ref('stock.stock_move_action').read()[0] + action = self.env.ref('stock.stock_move_action').sudo().read()[0] action['domain'] = [('product_id', 'in', self.ids)] action['context'] = {'search_default_done': True} return action