Merge lp:~openerp-dev/openobject-addons/trunk-bug-997642-amb into lp:openobject-addons

Proposed by Amit Bhavsar (Open ERP)
Status: Merged
Merged at revision: 7669
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-997642-amb
Merge into: lp:openobject-addons
Diff against target: 22 lines (+3/-2)
1 file modified
project_mrp/project_procurement.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-997642-amb
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+121393@code.launchpad.net

Description of the change

Hello,

It's raised the problem when create S.O with project_mrp installed for service product.
Now Fixes the problem of procurement for service product with latest addons.

Thanks!

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

The proposed patch was not good: proc.procurement_method instead of proc.product_id.procure_method

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project_mrp/project_procurement.py'
2--- project_mrp/project_procurement.py 2012-08-06 06:11:13 +0000
3+++ project_mrp/project_procurement.py 2012-08-27 10:18:02 +0000
4@@ -37,8 +37,9 @@
5 """ Checks if task is done or not.
6 @return: True or False.
7 """
8- return all(proc.product_id.type != 'service' or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \
9+ 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')) \
10 for proc in self.browse(cr, uid, ids, context=context))
11+ return res
12
13 def check_produce_service(self, cr, uid, procurement, context=None):
14 return True
15@@ -80,7 +81,7 @@
16 'project_id': project and project.id or False,
17 'company_id': procurement.company_id.id,
18 },context=context)
19- self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running'}, context=context)
20+ self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':'from project: task created.'}, context=context)
21 self.running_send_note(cr, uid, ids, context=None)
22 return task_id
23

Subscribers

People subscribed via source and target branches

to all changes: