[FIX] procurement: no procurement rule needed for digital products

The refactoring of product added a new type of product besides stockable/consumable/service: digital
It usually behaves like a service, for example it does not need a procurement rule (which is the point of this fix)
This commit is contained in:
Damien Bouvy
2015-10-05 17:31:13 +02:00
parent 0b5df29c8f
commit 1fcf5bdadc
+1 -1
View File
@@ -255,7 +255,7 @@ class procurement_order(osv.osv):
#if the procurement already has a rule assigned, we keep it (it has a higher priority as it may have been chosen manually)
if procurement.rule_id:
return True
elif procurement.product_id.type != 'service':
elif procurement.product_id.type not in ('service', 'digital'):
rule_id = self._find_suitable_rule(cr, uid, procurement, context=context)
if rule_id:
self.write(cr, uid, [procurement.id], {'rule_id': rule_id}, context=context)