Merge lp:~openerp-dev/openobject-addons/trunk-bug-942159-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-942159-amp
Merge into: lp:openobject-addons
Diff against target: 36 lines (+13/-0)
1 file modified
stock/stock.py (+13/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-942159-amp
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+98780@code.launchpad.net

Description of the change

steps:
1) Create product(set purchase tracking true) with minimum stock rule (real stock=0.0) now create a SO for this product.
2) Run the scheduler, PO will be created for this product from the scheduler.
3) Confirm the PO and go to reception assign the production lot done the reception.
4) Open the done procurement (which was created PO), you can see your production lot doesn't link to the procurement.

This functionality properly works with 6.0
Due to this fix this problem will solved

To post a comment you must log in.

Unmerged revisions

6682. By marta(pexego)

[FIX] stock : Production lot link from the PO to procurement for input traceability

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 2012-03-20 18:29:12 +0000
3+++ stock/stock.py 2012-03-22 05:27:19 +0000
4@@ -2211,6 +2211,12 @@
5 """ Makes the move done and if all moves are done, it will finish the picking.
6 @return:
7 """
8+ partial_datas=''
9+ partial_obj=self.pool.get('stock.partial.picking')
10+ partial_id=partial_obj.search(cr,uid,[])
11+ if partial_id:
12+ partial_datas = partial_obj.read(cr, uid, partial_id, context=context)[0]
13+
14 picking_ids = []
15 move_ids = []
16 wf_service = netsvc.LocalService("workflow")
17@@ -2236,6 +2242,10 @@
18 self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})
19 #cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id))
20 if move.move_dest_id.state in ('waiting', 'confirmed'):
21+ if partial_datas['picking_id'][1][:2] == 'IN' and move.location_dest_id:
22+ self.write(cr, uid, [move.move_dest_id.id], {'location_dest_id': move.location_dest_id.id})
23+ if move.prodlot_id.id and move.product_id.id == move.move_dest_id.product_id.id:
24+ self.write(cr, uid, [move.move_dest_id.id], {'prodlot_id':move.prodlot_id.id})
25 self.force_assign(cr, uid, [move.move_dest_id.id], context=context)
26 if move.move_dest_id.picking_id:
27 wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
28@@ -2243,6 +2253,9 @@
29 self.action_done(cr, uid, [move.move_dest_id.id], context=context)
30
31 self._create_product_valuation_moves(cr, uid, move, context=context)
32+ prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)
33+ if prodlot_id:
34+ self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)
35 if move.state not in ('confirmed','done','assigned'):
36 todo.append(move.id)
37

Subscribers

People subscribed via source and target branches

to all changes: