diff --git a/addons/project_mrp/project_procurement.py b/addons/project_mrp/project_procurement.py index 299a74f52aa..a8c0ed6ab21 100644 --- a/addons/project_mrp/project_procurement.py +++ b/addons/project_mrp/project_procurement.py @@ -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