Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-578768-port-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #898498 in OpenERP Addons: "[6.0.3] Physical inventory - import inventory 
action broken"
  https://bugs.launchpad.net/openobject-addons/+bug/898498

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-578768-port-mma/+merge/132541

Hello,

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

   If we try to fill inventory for location 'Stock',
   It search for all the stock movements with location 'Stock' as Source or 
Destination
   which includes dummy movement too and adds qty for dummy movement which 
results into
   posting wrong move for inventory.

   Code is forward port from 6.1


Thanks
Mayur
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-578768-port-mma/+merge/132541
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-578768-port-mma.
=== modified file 'stock/wizard/stock_fill_inventory.py'
--- stock/wizard/stock_fill_inventory.py	2012-09-29 10:51:04 +0000
+++ stock/wizard/stock_fill_inventory.py	2012-11-01 12:55:26 +0000
@@ -79,8 +79,6 @@
 
         inventory_line_obj = self.pool.get('stock.inventory.line')
         location_obj = self.pool.get('stock.location')
-        product_obj = self.pool.get('product.product')
-        stock_location_obj = self.pool.get('stock.location')
         move_obj = self.pool.get('stock.move')
         uom_obj = self.pool.get('product.uom')
         if ids and len(ids):
@@ -104,7 +102,11 @@
         for location in location_ids:
             datas = {}
             res[location] = {}
-            move_ids = move_obj.search(cr, uid, ['|',('location_dest_id','=',location),('location_id','=',location),('state','=','done')], context=context)
+            move_ids = move_obj.search(cr, uid, ['|', '&', ('location_id', '!=', location),
+                                                ('location_dest_id', '=', location),
+                                                '&', ('location_id', '=', location),
+                                                ('location_dest_id', '!=', location),
+                                                ('state', '=', 'done')], context=context)
 
             for move in move_obj.browse(cr, uid, move_ids, context=context):
                 lot_id = move.prodlot_id.id

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to