openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #05724
[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-764281-aag into lp:openobject-addons
Atik Agewan(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-764281-aag into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #764281 in OpenERP Addons: "MRP: Setting one work order to "In progress" sets all work orders to "In Progress""
https://bugs.launchpad.net/openobject-addons/+bug/764281
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-764281-aag/+merge/58445
'[Fix]MRP: Setting one work order to In progress '
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-764281-aag/+merge/58445
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-764281-aag.
=== modified file 'mrp_operations/mrp_operations.py'
--- mrp_operations/mrp_operations.py 2011-03-11 15:18:19 +0000
+++ mrp_operations/mrp_operations.py 2011-04-20 07:32:35 +0000
@@ -232,10 +232,13 @@
""" Finishes work order if production order is done.
@return: Super method
"""
+ work_obj = self.pool.get('mrp.production.workcenter.line')
obj = self.browse(cr, uid, ids)[0]
wf_service = netsvc.LocalService("workflow")
for workcenter_line in obj.workcenter_lines:
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr)
+ if workcenter_line.state == 'draft':
+ work_obj.write(cr, uid, workcenter_line.id, {'state': 'done'})
return super(mrp_production,self).action_production_end(cr, uid, ids)
def action_in_production(self, cr, uid, ids):
@@ -243,9 +246,12 @@
@return: True
"""
obj = self.browse(cr, uid, ids)[0]
+ workcenter_pool = self.pool.get('mrp.production.workcenter.line')
wf_service = netsvc.LocalService("workflow")
- for workcenter_line in obj.workcenter_lines:
- wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
+ for prod in self.browse(cr, uid, ids):
+ workorder_ids = workcenter_pool.search(cr, uid, [('production_id', '=', prod.id)], limit=1)
+ for wo_id in workorder_ids:
+ wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wo_id, 'button_start_working', cr)
return super(mrp_production,self).action_in_production(cr, uid, ids)
def action_cancel(self, cr, uid, ids, context=None):