[FIX] project_mrp : Fixes the problem of procurement for service product.

lp bug: https://launchpad.net/bugs/997642 fixed

bzr revid: amb@tinyerp.com-20120827100246-y9d38makz4iumlk0
This commit is contained in:
Yann papouin
2012-08-27 15:32:46 +05:30
committed by Amit Bhavsar (Open ERP)
parent 65f532e001
commit dd6e836c61
+3 -2
View File
@@ -37,8 +37,9 @@ class procurement_order(osv.osv):
""" Checks if task is done or not.
@return: True or False.
"""
return all(proc.product_id.type != 'service' or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \
res = all((proc.product_id.type != 'service') or ((proc.product_id.type == 'service') and (proc.product_id.procure_method == 'make_to_stock')) or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \
for proc in self.browse(cr, uid, ids, context=context))
return res
def check_produce_service(self, cr, uid, procurement, context=None):
return True
@@ -80,7 +81,7 @@ class procurement_order(osv.osv):
'project_id': project and project.id or False,
'company_id': procurement.company_id.id,
},context=context)
self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running'}, context=context)
self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':'from project: task created.'}, context=context)
self.running_send_note(cr, uid, ids, context=None)
return task_id