diff options
| author | Harry (OpenERP) <hmo@tinyerp.com> | 2012-10-03 17:49:04 +0530 |
|---|---|---|
| committer | Harry (OpenERP) <hmo@tinyerp.com> | 2012-10-03 17:49:04 +0530 |
| commit | 71bf16d126e2719fe9fd4da12e09d3e75be785b8 (patch) | |
| tree | 6d47c7594ef0756ca369423311ef26b7928ceaa8 | |
| parent | dd44dab68c94cf88b2d9e16e614741680483d508 (diff) | |
[FIX] stock_location: fix issue to post message after created pulled procurement
bzr revid: hmo@tinyerp.com-20121003121904-x930vx8rs0y80xre
| -rw-r--r-- | addons/stock_location/procurement_pull.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/stock_location/procurement_pull.py b/addons/stock_location/procurement_pull.py index 840e6c854c7..87af0c7e08d 100644 --- a/addons/stock_location/procurement_pull.py +++ b/addons/stock_location/procurement_pull.py @@ -57,6 +57,7 @@ class procurement_order(osv.osv): break assert line, 'Line cannot be False if we are on this state of the workflow' origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name + #TOFIX: implement hook method for creating picking picking_id = picking_obj.create(cr, uid, { 'origin': origin, 'company_id': line.company_id and line.company_id.id or False, @@ -67,6 +68,7 @@ class procurement_order(osv.osv): 'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s (#%d)') % (proc.location_id.name, line.name, proc.name, proc.id), 'invoice_state': line.invoice_state, }) + #TOFIX: implement hook method for creating move move_id = move_obj.create(cr, uid, { 'name': line.name, 'picking_id': picking_id, @@ -92,6 +94,8 @@ class procurement_order(osv.osv): move_obj.write(cr,uid, [proc.move_id.id], { 'state':'waiting' }, context=context) + + #TOFIX: implement hook method for creating new procurement proc_id = proc_obj.create(cr, uid, { 'name': line.name, 'origin': origin, @@ -115,9 +119,9 @@ class procurement_order(osv.osv): if proc.move_id: move_obj.write(cr, uid, [proc.move_id.id], {'location_id':proc.location_id.id}) - self.write(cr, uid, [proc.id], {'state':'running', 'message':_('Pulled from another location via procurement %d') % proc_id}) - self.running_send_note(cr, uid, [proc.id], context=context) - + msg = _('Pulled from another location via procurement %d') % proc_id + self.write(cr, uid, [proc.id], {'state':'running', 'message': msg}) + self.message_post(cr, uid, [proc.id], body=msg, context=context) # trigger direct processing (the new procurement shares the same planned date as the original one, which is already being processed) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) return False |
