diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index a0b3849c7966690f72f72ad9407bc1853d83bc06..a37eda67d45dabf4dc853a01ea14fdc4d0237917 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -739,7 +739,7 @@ class ProductTemplate(models.Model): if 'type' in vals and vals['type'] != 'product' and sum(self.mapped('nbr_reordering_rules')) != 0: raise UserError(_('You still have some active reordering rules on this product. Please archive or delete them first.')) if any('type' in vals and vals['type'] != prod_tmpl.type for prod_tmpl in self): - existing_done_move_lines = self.env['stock.move.line'].search([ + existing_done_move_lines = self.env['stock.move.line'].sudo().search([ ('product_id', 'in', self.mapped('product_variant_ids').ids), ('state', '=', 'done'), ], limit=1)