From 71dec5c1d83c4ab0c32591b5b5949f56fba41e1f Mon Sep 17 00:00:00 2001 From: Giovanni Date: Thu, 21 Apr 2022 14:13:48 +0200 Subject: [PATCH] [FIX] rma_sale: issue opening rma view from wizard + action permission issues --- rma_sale/README.rst | 1 + rma_sale/__manifest__.py | 2 +- rma_sale/models/sale.py | 2 +- rma_sale/readme/CONTRIBUTORS.rst | 1 + rma_sale/static/description/index.html | 1 + rma_sale/wizard/sale_order_rma_wizard.py | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rma_sale/README.rst b/rma_sale/README.rst index b2d80532..07a21163 100644 --- a/rma_sale/README.rst +++ b/rma_sale/README.rst @@ -101,6 +101,7 @@ Contributors * David Vidal * Chafique Delli +* Giovanni Serra - Ooops Maintainers ~~~~~~~~~~~ diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py index 6373270d..e486ad43 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with Sales", "summary": "Sale Order - Return Merchandise Authorization (RMA)", - "version": "14.0.1.0.1", + "version": "14.0.1.2.0", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma_sale/models/sale.py b/rma_sale/models/sale.py index 78b65170..3c15ad7b 100644 --- a/rma_sale/models/sale.py +++ b/rma_sale/models/sale.py @@ -60,7 +60,7 @@ class SaleOrder(models.Model): def action_view_rma(self): self.ensure_one() - action = self.env.ref("rma.rma_action").read()[0] + action = self.sudo().env.ref("rma.rma_action").read()[0] rma = self.rma_ids if len(rma) == 1: action.update( diff --git a/rma_sale/readme/CONTRIBUTORS.rst b/rma_sale/readme/CONTRIBUTORS.rst index 49a9884e..c93f1606 100644 --- a/rma_sale/readme/CONTRIBUTORS.rst +++ b/rma_sale/readme/CONTRIBUTORS.rst @@ -5,3 +5,4 @@ * David Vidal * Chafique Delli +* Giovanni Serra - Ooops diff --git a/rma_sale/static/description/index.html b/rma_sale/static/description/index.html index ffa4f8f4..46d15790 100644 --- a/rma_sale/static/description/index.html +++ b/rma_sale/static/description/index.html @@ -451,6 +451,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Chafique Delli <chafique.delli@akretion.com>
  • +
  • Giovanni Serra - Ooops <giovanni@ooops404.com>
  • diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index f129c818..baac18a2 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -75,7 +75,7 @@ class SaleOrderRmaWizard(models.TransientModel): return for rec in rma: rec.action_confirm() - action = self.env.ref("rma.rma_action").read()[0] + action = self.sudo().env.ref("rma.rma_action").read()[0] if len(rma) > 1: action["domain"] = [("id", "in", rma.ids)] elif rma: