diff options
Diffstat (limited to 'addons/procurement/procurement.py')
| -rw-r--r-- | addons/procurement/procurement.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 9b298915f12..7382b1577e7 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -375,11 +375,10 @@ class procurement_order(osv.osv): id = procurement.move_id.id if not (procurement.move_id.state in ('done','assigned','cancel')): ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) - cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,)) - res = cr.fetchone()[0] - if not res and not ok: + order_point_id = self.pool.get('stock.warehouse.orderpoint').search(cr, uid, [('product_id', '=', procurement.product_id.id)], context=context) + if not order_point_id and not ok: message = _("Not enough stock and no minimum orderpoint rule defined.") - elif not res: + elif not order_point_id: message = _("No minimum orderpoint rule defined.") elif not ok: message = _("Not enough stock.") |
