Merge lp:~openerp-dev/openobject-addons/6.0-bug-740047-rch into lp:openobject-addons/6.0

Proposed by Riken Bhorania (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-bug-740047-rch
Merge into: lp:openobject-addons/6.0
Diff against target: 44 lines (+19/-15)
1 file modified
mrp/mrp.py (+19/-15)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-bug-740047-rch
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) Pending
Review via email: mp+65310@code.launchpad.net

Description of the change

Hello Sir,

When 'Raw Materials Location' and 'Source Location' of 'Products to Consume' in the MO is same then stock move(s) from 'Raw Materials Location' to 'Source Location' should not be generated.

Also no need to create Procurement(s) regarding this kind of stock move(s).

Thanks.

To post a comment you must log in.

Unmerged revisions

4669. By Riken Bhorania (OpenERP)

[FIX] mrp : No need to create extra stock move(s) from MO when 'Raw Materials Location' and 'Source Location' of 'Products to Consume' is same.

4668. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4667. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/mrp.py'
2--- mrp/mrp.py 2011-04-04 11:25:26 +0000
3+++ mrp/mrp.py 2011-06-21 07:31:34 +0000
4@@ -888,21 +888,25 @@
5 'company_id': production.company_id.id,
6 })
7 moves.append(res_dest_id)
8- move_id = move_obj.create(cr, uid, {
9- 'name':'PROD:' + production.name,
10- 'picking_id':picking_id,
11- 'product_id': line.product_id.id,
12- 'product_qty': line.product_qty,
13- 'product_uom': line.product_uom.id,
14- 'product_uos_qty': line.product_uos and line.product_uos_qty or False,
15- 'product_uos': line.product_uos and line.product_uos.id or False,
16- 'date': newdate,
17- 'move_dest_id': res_dest_id,
18- 'location_id': production.location_src_id.id,
19- 'location_dest_id': routing_loc or production.location_src_id.id,
20- 'state': 'waiting',
21- 'company_id': production.company_id.id,
22- })
23+ previous_move_obj = move_obj.browse(cr, uid, res_dest_id)
24+ if production.location_src_id.id != previous_move_obj.location_id.id:
25+ move_id = move_obj.create(cr, uid, {
26+ 'name':'PROD:' + production.name,
27+ 'picking_id':picking_id,
28+ 'product_id': line.product_id.id,
29+ 'product_qty': line.product_qty,
30+ 'product_uom': line.product_uom.id,
31+ 'product_uos_qty': line.product_uos and line.product_uos_qty or False,
32+ 'product_uos': line.product_uos and line.product_uos.id or False,
33+ 'date': newdate,
34+ 'move_dest_id': res_dest_id,
35+ 'location_id': production.location_src_id.id,
36+ 'location_dest_id': routing_loc or production.location_src_id.id,
37+ 'state': 'waiting',
38+ 'company_id': production.company_id.id,
39+ })
40+ else:
41+ continue;
42 proc_id = proc_obj.create(cr, uid, {
43 'name': (production.origin or '').split(':')[0] + ':' + production.name,
44 'origin': (production.origin or '').split(':')[0] + ':' + production.name,