From 45d734badfd97782270d63c81db0149fe26e2466 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 3 Feb 2021 18:05:03 +0100 Subject: [PATCH] Fix access rights in product_print_zpl_barcode In odoo v14, read of ir.actions.act_windows is restricted to base.group_system --- product_print_zpl_barcode/models/product.py | 2 +- product_print_zpl_barcode/wizard/product_print_zpl_barcode.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/product_print_zpl_barcode/models/product.py b/product_print_zpl_barcode/models/product.py index 908d84e..6853de6 100644 --- a/product_print_zpl_barcode/models/product.py +++ b/product_print_zpl_barcode/models/product.py @@ -35,7 +35,7 @@ class ProductTemplate(models.Model): "because it has %d variants and not just one.") % (self.display_name, self.product_variant_count)) action = self.env.ref( - 'product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + 'product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action['context'] = { 'active_id': self.product_variant_ids[0].id, 'active_model': 'product.product', diff --git a/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py b/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py index 26be01a..45a05b1 100644 --- a/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py +++ b/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py @@ -270,7 +270,7 @@ class ProductPrintZplBarcode(models.TransientModel): 'zpl_filename': 'barcode_%s.zpl' % vals['barcode'], }) self.write(vals) - action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action.update({ 'res_id': self.id, 'context': self._context, @@ -285,7 +285,7 @@ class ProductPrintZplBarcode(models.TransientModel): self.zpl_filename, base64.decodebytes(self.zpl_file), format='raw') action = True if self._context.get('print_and_new'): - action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action.update({ 'views': False, 'context': self._context,