diff options
| author | Josse Colpaert <jco@openerp.com> | 2013-09-16 11:37:10 +0200 |
|---|---|---|
| committer | Josse Colpaert <jco@openerp.com> | 2013-09-16 11:37:10 +0200 |
| commit | 17258b6a9acf6421713ffd9c8d46aab0b2bbf73e (patch) | |
| tree | 10ca8756ed97a3244bd6918a0a5b6dd94635c03f /addons | |
| parent | bf7a359abe49c83ef74aca8401fe970d3b68e570 (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/procurement/procurement.py | 9 | ||||
| -rw-r--r-- | 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): |
