Merge lp:~unifield-team/unifield-server/us-2609 into lp:unifield-server

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4275
Proposed branch: lp:~unifield-team/unifield-server/us-2609
Merge into: lp:unifield-server
Diff against target: 21 lines (+5/-6)
1 file modified
bin/addons/consumption_calculation/history_consumption.py (+5/-6)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-2609
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+319543@code.launchpad.net
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 'bin/addons/consumption_calculation/history_consumption.py'
2--- bin/addons/consumption_calculation/history_consumption.py 2017-03-06 17:14:31 +0000
3+++ bin/addons/consumption_calculation/history_consumption.py 2017-03-10 09:49:09 +0000
4@@ -251,12 +251,11 @@
5 ''')
6 else:
7 cr.execute('''
8- SELECT distinct(product_id)
9- FROM stock_move
10- WHERE state = 'done'
11- AND
12- (location_id IN %s OR location_dest_id IN %s)
13- ''', (tuple(context.get('location_id', [])), tuple(context.get('location_id', []))))
14+ SELECT distinct(s.product_id)
15+ FROM stock_move s
16+ LEFT JOIN stock_location l ON l.id = s.location_id OR l.id = s.location_dest_id
17+ WHERE l.usage in ('customer', 'internal')
18+ ''')
19 product_ids = [x[0] for x in cr.fetchall()]
20
21 # split ids into slices to not read a lot record in the same time (memory)

Subscribers

People subscribed via source and target branches

to all changes: