diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py index d6f9875459d..b5f785d245e 100644 --- a/addons/stock/procurement.py +++ b/addons/stock/procurement.py @@ -56,7 +56,7 @@ class procurement_order(osv.osv): def _find_suitable_rule(self, cr, uid, procurement, context=None): rule_id = super(procurement_order, self)._find_suitable_rule(cr, uid, procurement, context=context) - if not res: + if not rule_id: rule_id = self._search_suitable_rule(cr, uid, procurement, [('action', '=', 'move'), ('location_id', '=', procurement.location_id.id)], context=context) rule_id = rule_id and rule_id[0] or False return rule_id