Amit Parik (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-998631-amp into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #998631 in OpenERP Addons: "stock wrong computation of internal moves in
get_product_available"
https://bugs.launchpad.net/openobject-addons/+bug/998631
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-998631-amp/+merge/106337
Hello,
This branch has fixes some hidden bug on get_product_available function.
Removed the tuple(location_ids) which is double times written and We don't have
to check location_id for 'in' picking as well as don't have to check
destination location for 'out' picking.
Thanks!
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-998631-amp/+merge/106337
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-998631-amp.
=== modified file 'stock/product.py'
--- stock/product.py 2012-07-25 10:30:41 +0000
+++ stock/product.py 2012-08-30 10:23:20 +0000
@@ -261,7 +261,7 @@
to_date = context.get('to_date',False)
date_str = False
date_values = False
- where = [tuple(location_ids),tuple(location_ids),tuple(ids),tuple(states)]
+ where = [tuple(location_ids),tuple(ids),tuple(states)]
if from_date and to_date:
date_str = "date>=%s and date<=%s"
where.append(tuple([from_date]))
@@ -283,8 +283,7 @@
cr.execute(
'select sum(product_qty), product_id, product_uom '\
'from stock_move '\
- 'where location_id NOT IN %s '\
- 'and location_dest_id IN %s '\
+ 'where location_dest_id IN %s '\
'and product_id IN %s '\
'' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
'and state IN %s ' + (date_str and 'and '+date_str+' ' or '') +' '\
@@ -296,7 +295,6 @@
'select sum(product_qty), product_id, product_uom '\
'from stock_move '\
'where location_id IN %s '\
- 'and location_dest_id NOT IN %s '\
'and product_id IN %s '\
'' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
'and state in %s ' + (date_str and 'and '+date_str+' ' or '') + ' '\
_______________________________________________
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