From 1fdaf5278756c81d83c2c50cd1edcd651b43dae5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 30 Mar 2022 17:22:27 +0200 Subject: [PATCH] stock_valuation_xlsx: fix access right issue --- stock_valuation_xlsx/wizard/stock_valuation_xlsx.py | 2 +- stock_valuation_xlsx/wizard/stock_variation_xlsx.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py index 131d134..edd9dd7 100644 --- a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py +++ b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py @@ -97,7 +97,7 @@ class StockValuationXlsx(models.TransientModel): raise UserError(_( "The selected inventory (%s) is not in done state.") % self.inventory_id.display_name) - cost_method_real_count = self.env['ir.property'].search([ + cost_method_real_count = self.env['ir.property'].sudo().search([ ('company_id', '=', company_id), ('name', '=', 'property_cost_method'), ('value_text', '=', 'real'), diff --git a/stock_valuation_xlsx/wizard/stock_variation_xlsx.py b/stock_valuation_xlsx/wizard/stock_variation_xlsx.py index b29cd85..fa63fca 100644 --- a/stock_valuation_xlsx/wizard/stock_variation_xlsx.py +++ b/stock_valuation_xlsx/wizard/stock_variation_xlsx.py @@ -79,7 +79,7 @@ class StockVariationXlsx(models.TransientModel): else: if self.start_date >= present: raise UserError(_("The start date must be in the past.")) - cost_method_real_count = self.env['ir.property'].search([ + cost_method_real_count = self.env['ir.property'].sudo().search([ ('company_id', '=', company_id), ('name', '=', 'property_cost_method'), ('value_text', '=', 'real'),