From b3ca9d0ee80207e904e800ba16d37f52e23a7708 Mon Sep 17 00:00:00 2001 From: lreficent Date: Tue, 9 Jan 2018 18:26:29 +0100 Subject: [PATCH] optimize --- stock_orderpoint_uom/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_orderpoint_uom/models/product_template.py b/stock_orderpoint_uom/models/product_template.py index 600e448a3..78ca59ec4 100644 --- a/stock_orderpoint_uom/models/product_template.py +++ b/stock_orderpoint_uom/models/product_template.py @@ -16,7 +16,7 @@ class ProductTemplate(models.Model): orderpoint = self.env['stock.warehouse.orderpoint'].search([ ('procure_uom_id.category_id', '!=', rec.uom_id.category_id.id), - ('product_id.product_tmpl_id', '=', rec.id)], limit=1) + ('product_id', 'in', rec.product_variant_ids.ids)], limit=1) if orderpoint: raise UserError( _("At least one reordering rule for this product has a "