[IMP] When stock is installed and there is a rule for a product of type service,...
authorJosse Colpaert <jco@openerp.com>
Mon, 16 Sep 2013 09:37:10 +0000 (11:37 +0200)
committerJosse Colpaert <jco@openerp.com>
Mon, 16 Sep 2013 09:37:10 +0000 (11:37 +0200)
bzr revid: jco@openerp.com-20130916093710-6gweaj5o0yp20ry5

addons/procurement/procurement.py
addons/project_mrp/project_mrp.py

index 62170c1..1566cf0 100644 (file)
@@ -194,10 +194,11 @@ class procurement_order(osv.osv):
             :param procurement: browse record
             :rtype: boolean
         '''
-        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)
-            return True
+        if procurement.product_id.type != 'service':
+            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)
+                return True
         return False
 
     def _run(self, cr, uid, procurement, context=None):
index 231132a..7c478b6 100644 (file)
@@ -165,7 +165,7 @@ class sale_order(osv.osv):
     def _check_create_procurement(self, cr, uid, order, line, context=None):
         create = super(sale_order, self)._check_create_procurement(cr, uid, order, line, context=context)
         if (line.product_id.type== "service" and not line.product_id.auto_create_task):
-            create = True
+            create = False
         return create
 
     def _picked_rate(self, cr, uid, ids, name, arg, context=None):