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'),