Merge lp:~dorian-kemps/unifield-server/US-8384 into lp:unifield-server

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~dorian-kemps/unifield-server/US-8384
Merge into: lp:unifield-server
Diff against target: 29 lines (+9/-10)
1 file modified
bin/addons/sales_followup/report/ir_follow_up_location_report.py (+9/-10)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-8384
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+405085@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/sales_followup/report/ir_follow_up_location_report.py'
2--- bin/addons/sales_followup/report/ir_follow_up_location_report.py 2020-11-09 16:15:15 +0000
3+++ bin/addons/sales_followup/report/ir_follow_up_location_report.py 2021-07-02 09:34:23 +0000
4@@ -329,16 +329,15 @@
5 fl_index = m_index
6 m_index += 1
7 else: # No move found
8- # Look for received qty in the IN(s) linked to a non-stockable product
9- if line.product_id and line.product_id.type in ['consu', 'service_recep']:
10- self.cr.execute("""
11- SELECT m.product_qty FROM stock_move m
12- LEFT JOIN purchase_order_line pl ON m.purchase_line_id = pl.id
13- LEFT JOIN sale_order_line sl ON pl.linked_sol_id = sl.id
14- WHERE m.state = 'done' AND m.type = 'in' AND sl.id = %s
15- """, (line.id,))
16- for move in self.cr.fetchall():
17- received_qty += move[0]
18+ # Look for received qty in the IN(s)
19+ self.cr.execute("""
20+ SELECT m.product_qty FROM stock_move m
21+ LEFT JOIN purchase_order_line pl ON m.purchase_line_id = pl.id
22+ LEFT JOIN sale_order_line sl ON pl.linked_sol_id = sl.id
23+ WHERE m.state = 'done' AND m.type = 'in' AND sl.id = %s
24+ """, (line.id,))
25+ for move in self.cr.fetchall():
26+ received_qty += move[0]
27
28 if first_line:
29 data = {

Subscribers

People subscribed via source and target branches