Merge lp:~openerp-dev/openobject-addons/trunk-bug-998631-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Merged
Merged at revision: 7640
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-998631-amp
Merge into: lp:openobject-addons
Diff against target: 30 lines (+2/-4)
1 file modified
stock/product.py (+2/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-998631-amp
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+106337@code.launchpad.net

Description of the change

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!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/product.py'
2--- stock/product.py 2012-07-25 10:30:41 +0000
3+++ stock/product.py 2012-08-30 10:23:20 +0000
4@@ -261,7 +261,7 @@
5 to_date = context.get('to_date',False)
6 date_str = False
7 date_values = False
8- where = [tuple(location_ids),tuple(location_ids),tuple(ids),tuple(states)]
9+ where = [tuple(location_ids),tuple(ids),tuple(states)]
10 if from_date and to_date:
11 date_str = "date>=%s and date<=%s"
12 where.append(tuple([from_date]))
13@@ -283,8 +283,7 @@
14 cr.execute(
15 'select sum(product_qty), product_id, product_uom '\
16 'from stock_move '\
17- 'where location_id NOT IN %s '\
18- 'and location_dest_id IN %s '\
19+ 'where location_dest_id IN %s '\
20 'and product_id IN %s '\
21 '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
22 'and state IN %s ' + (date_str and 'and '+date_str+' ' or '') +' '\
23@@ -296,7 +295,6 @@
24 'select sum(product_qty), product_id, product_uom '\
25 'from stock_move '\
26 'where location_id IN %s '\
27- 'and location_dest_id NOT IN %s '\
28 'and product_id IN %s '\
29 '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
30 'and state in %s ' + (date_str and 'and '+date_str+' ' or '') + ' '\

Subscribers

People subscribed via source and target branches

to all changes: