diff options
| author | Rucha (Open ERP) <rpa@tinyerp.com> | 2011-11-02 10:58:27 +0530 |
|---|---|---|
| committer | Rucha (Open ERP) <rpa@tinyerp.com> | 2011-11-02 10:58:27 +0530 |
| commit | 2fdecf4717080ea98a514b67dedefc27d76c6727 (patch) | |
| tree | bb54dd0e81af0bbf999fee1110fecb9e507f51e1 /addons/procurement/procurement.py | |
| parent | 9fe0f6fa83b84d0806359bdc2a3ae31dfb7e997a (diff) | |
| parent | 3d22bb8b55d48e5ee8226f023555f003288b157a (diff) | |
[MERGE]: Merge with latest trunk
bzr revid: rpa@tinyerp.com-20111102052827-0bctjrhb4amyg6pl
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.") |
