Merge lp:~openerp-dev/openobject-addons/6.0-opw-578768-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5336
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-578768-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 24 lines (+5/-2)
1 file modified
stock/wizard/stock_fill_inventory.py (+5/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-578768-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+122630@code.launchpad.net

Description of the change

Hello,

Fixed problem of 'Fill Inventory' wizard which adds qty for dummy moves also,
Ex. Stock -> Stock

If we try to fill inventory for location 'Stock',
It searches for all possible stock movements with location 'Stock' as Source or Destination
which includes dummy movement too which results into posting wrong qty moves for inventory.

Detail steps are provided in lp:1045334

Please review this fix.

To post a comment you must log in.
5336. By Rifakat Husen (OpenERP)

[IMP] improved code, fetch result in a single search() domain

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5336. By Rifakat Husen (OpenERP)

[IMP] improved code, fetch result in a single search() domain

5335. By Rifakat Husen (OpenERP)

[IMP] optimized code

5334. By Rifakat Husen (OpenERP)

[IMP] removed unused import

5333. By Rifakat Husen (OpenERP)

[FIX] stock: fixed import invertory wizard problem, restricted dummy moves' qty to be added into total

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/wizard/stock_fill_inventory.py'
2--- stock/wizard/stock_fill_inventory.py 2012-04-25 12:22:20 +0000
3+++ stock/wizard/stock_fill_inventory.py 2012-09-04 13:10:29 +0000
4@@ -67,7 +67,6 @@
5
6 inventory_line_obj = self.pool.get('stock.inventory.line')
7 location_obj = self.pool.get('stock.location')
8- product_obj = self.pool.get('product.product')
9 move_obj = self.pool.get('stock.move')
10 uom_obj = self.pool.get('product.uom')
11
12@@ -87,7 +86,11 @@
13 for location in location_ids:
14 datas = {}
15 res[location] = {}
16- move_ids = move_obj.search(cr, uid, ['|',('location_dest_id','=',location),('location_id','=',location),('state','=','done')], context=context)
17+ move_ids = move_obj.search(cr, uid, ['|', '&', ('location_id', '!=', location),
18+ ('location_dest_id', '=', location),
19+ '&', ('location_id', '=', location),
20+ ('location_dest_id', '!=', location),
21+ ('state', '=', 'done')], context=context)
22
23 for move in move_obj.browse(cr, uid, move_ids, context=context):
24 lot_id = move.prodlot_id.id