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

Proposed by jftempo
Status: Merged
Merged at revision: 4214
Proposed branch: lp:~unifield-team/unifield-server/us-1552
Merge into: lp:unifield-server
Diff against target: 53 lines (+9/-7)
1 file modified
bin/addons/msf_supply_doc_export/msf_supply_doc_export.py (+9/-7)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-1552
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+317103@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/msf_supply_doc_export/msf_supply_doc_export.py'
2--- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2016-11-09 08:28:09 +0000
3+++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2017-02-13 13:49:10 +0000
4@@ -490,7 +490,7 @@
5 report_lines.extend(self.printAnalyticLines(analytic_lines))
6 first_line = False
7
8- for spsul in same_product_same_uom:
9+ for spsul in sorted(same_product_same_uom, key=lambda spsu: spsu.get('backorder_id'), reverse=True):
10 report_line = {
11 'order_ref': order.name or '',
12 'order_created': order.date_order or '',
13@@ -511,14 +511,15 @@
14 }
15
16 report_lines.append(report_line)
17+
18+ if spsul.get('backorder_id') and spsul.get('state') != 'done':
19+ report_line['qty_backordered'] = spsul.get('product_qty', '')
20
21 if first_line:
22- if spsul.get('backorder_id') and spsul.get('state') != 'done':
23- report_line['qty_backordered'] = spsul.get('product_qty', '')
24 report_lines.extend(self.printAnalyticLines(analytic_lines))
25 first_line = False
26
27- for spl in same_product:
28+ for spl in sorted(same_product, key=lambda spsu: spsu.get('backorder_id'), reverse=True):
29 report_line = {
30 'order_ref': order.name or '',
31 'order_created': order.date_order or '',
32@@ -538,10 +539,11 @@
33 'in_unit_price': spl.get('price_unit'),
34 }
35 report_lines.append(report_line)
36+
37+ if spl.get('backorder_id') and spl.get('state') != 'done':
38+ report_line['qty_backordered'] = spl.get('product_qty', '')
39
40 if first_line:
41- if spl.get('backorder_id') and spl.get('state') != 'done':
42- report_line['qty_backordered'] = spl.get('product_qty', '')
43 report_lines.extend(self.printAnalyticLines(analytic_lines))
44 first_line = False
45
46@@ -597,7 +599,7 @@
47 AND
48 sm.picking_id = sp.id
49 ORDER BY
50- sp.name, sm.id asc''', tuple([po_line_id]))
51+ sp.name, sp.backorder_id, sm.id asc''', tuple([po_line_id]))
52 for res in self.cr.dictfetchall():
53 yield res
54

Subscribers

People subscribed via source and target branches

to all changes: