Amit Parik (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-981506-amp into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #981506 in OpenERP Addons: "wrong inventory computation if location_id 
and location_dest_id are identical"
  https://bugs.launchpad.net/openobject-addons/+bug/981506

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-981506-amp/+merge/102095

Hello,

Import Inventory (fill inventory) wizard  doesn't check the source location and 
destination location are same on stock move.
The problem is clearly displayed on video of lp:981506.

Also I have removed the unused code on same wizard

Thank you!
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-981506-amp/+merge/102095
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-981506-amp.
=== modified file 'stock/wizard/stock_fill_inventory.py'
--- stock/wizard/stock_fill_inventory.py	2011-12-08 05:58:41 +0000
+++ stock/wizard/stock_fill_inventory.py	2012-04-16 12:20:51 +0000
@@ -68,7 +68,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):
@@ -97,7 +96,9 @@
             for move in move_obj.browse(cr, uid, move_ids, context=context):
                 lot_id = move.prodlot_id.id
                 prod_id = move.product_id.id
-                if move.location_dest_id.id == location:
+                if  move.location_dest_id.id == move.location_id.id :
+                    qty = 0.0
+                elif move.location_dest_id.id == location:
                     qty = uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id)
                 else:
                     qty = -uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_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