Merge lp:~openerp-dev/openobject-addons/6.1-opw-578768-rha into lp:openobject-addons/6.1
Proposed by
Rifakat Husen (OpenERP)
Status: | Approved | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Naresh(OpenERP) | ||||||||
Approved revision: | 6978 | ||||||||
Proposed branch: | lp:~openerp-dev/openobject-addons/6.1-opw-578768-rha | ||||||||
Merge into: | lp:openobject-addons/6.1 | ||||||||
Diff against target: |
25 lines (+5/-3) 1 file modified
stock/wizard/stock_fill_inventory.py (+5/-3) |
||||||||
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578768-rha | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Naresh(OpenERP) (community) | Approve | ||
Review via email: mp+122627@code.launchpad.net |
Description of the change
Hello,
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.
Detail steps are provided in lp:1045334
Please review this fix.
Regards,
Rifakat
To post a comment you must log in.
Unmerged revisions
- 6978. By Rifakat Husen (OpenERP)
-
[IMP] improved code, fetch result in a single search() domain
- 6977. By Rifakat Husen (OpenERP)
-
[IMP] optimized code
- 6976. By Rifakat Husen (OpenERP)
-
[IMP] removed unused imports
- 6975. By Rifakat Husen (OpenERP)
-
[FIX] stock: fixed import invertory wizard problem, restricted dummy moves' qty to be added into total
Hello!
I do not know how the SQL statement will look like and how postgresql will optimize the search.
performance is critical and full table scans must be avoided
a statement like
select id from stock_move where (location_id = 12 and location_dest_id != 12) or (location_id !=12 and location_dest_id =12);
would generate an optimized query plan
QUERY PLAN ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---- location_ id_index (cost=0.00..55.68 rows=2590 width=0)
Index Cond: (location_id = 12) location_ dest_id_ index (cost=0.00..11.96 rows=495 width=0)
Index Cond: (location_dest_id = 12)
explain select id from stock_move where (location_id = 12 and location_dest_id != 12) or (location_id !=12 and location_dest_id =12);
-------
Bitmap Heap Scan on stock_move (cost=68.96..324.66 rows=2632 width=4)
Recheck Cond: ((location_id = 12) OR (location_dest_id = 12))
Filter: (((location_id = 12) AND (location_dest_id <> 12)) OR ((location_id <> 12) AND (location_dest_id = 12)))
-> BitmapOr (cost=68.96..68.96 rows=3085 width=0)
-> Bitmap Index Scan on stock_move_
-> Bitmap Index Scan on stock_move_