From 17258b6a9acf6421713ffd9c8d46aab0b2bbf73e Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 16 Sep 2013 11:37:10 +0200 Subject: [PATCH] [IMP] When stock is installed and there is a rule for a product of type service, do not apply rule bzr revid: jco@openerp.com-20130916093710-6gweaj5o0yp20ry5 --- addons/procurement/procurement.py | 9 +++++---- addons/project_mrp/project_mrp.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 62170c13eea..1566cf05045 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -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): diff --git a/addons/project_mrp/project_mrp.py b/addons/project_mrp/project_mrp.py index 231132a7e27..7c478b63ad6 100644 --- a/addons/project_mrp/project_mrp.py +++ b/addons/project_mrp/project_mrp.py @@ -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):