Merge lp:~openerp-dev/openobject-addons/6.0-bug-722538-jvo into lp:openobject-addons/6.0

Proposed by Jay Vora (Serpent Consulting Services)
Status: Merged
Merged at revision: 4532
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-bug-722538-jvo
Merge into: lp:openobject-addons/6.0
Diff against target: 33 lines (+8/-5)
1 file modified
stock/stock.py (+8/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-bug-722538-jvo
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Pending
Stephane Wirtel (OpenERP) Pending
OpenERP Core Team Pending
Review via email: mp+57135@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2011-04-04 10:02:08 +0000
3+++ stock/stock.py 2011-04-11 10:33:24 +0000
4@@ -2108,11 +2108,11 @@
5
6 todo = []
7 for move in self.browse(cr, uid, ids, context=context):
8- #print 'DONE MOVE', move.id, move.product_id.name, move.move_dest_id.id, move.state, move.move_dest_id and move.move_dest_id.state
9 if move.state=="draft":
10 todo.append(move.id)
11 if todo:
12 self.action_confirm(cr, uid, todo, context=context)
13+ todo = []
14
15 for move in self.browse(cr, uid, ids, context=context):
16 if move.state in ['done','cancel']:
17@@ -2135,10 +2135,13 @@
18 prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)
19 if prodlot_id:
20 self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)
21- if move.state not in ('confirmed','done'):
22- self.action_confirm(cr, uid, move_ids, context=context)
23-
24- self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
25+ if move.state not in ('confirmed','done','assigned'):
26+ todo.append(move.id)
27+
28+ if todo:
29+ self.action_confirm(cr, uid, todo, context=context)
30+
31+ self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
32 for id in move_ids:
33 wf_service.trg_trigger(uid, 'stock.move', id, cr)
34