Merge lp:~unifield-team/unifield-wm/us-34 into lp:unifield-wm
- us-34
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 2416 |
Proposed branch: | lp:~unifield-team/unifield-wm/us-34 |
Merge into: | lp:unifield-wm |
Diff against target: |
146 lines (+33/-14) 2 files modified
msf_supply_doc_export/msf_supply_doc_export.py (+19/-4) msf_supply_doc_export/report/report_po_follow_up_xls.mako (+14/-10) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-wm/us-34 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+252718@code.launchpad.net |
Commit message
Description of the change
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 'msf_supply_doc_export/msf_supply_doc_export.py' | |||
2 | --- msf_supply_doc_export/msf_supply_doc_export.py 2014-11-14 10:45:42 +0000 | |||
3 | +++ msf_supply_doc_export/msf_supply_doc_export.py 2015-03-12 10:46:41 +0000 | |||
4 | @@ -383,9 +383,6 @@ | |||
5 | 383 | def getRunParmsRML(self,key): | 383 | def getRunParmsRML(self,key): |
6 | 384 | return self.datas['report_parms'][key] | 384 | return self.datas['report_parms'][key] |
7 | 385 | 385 | ||
8 | 386 | def getPOLineHeaders(self): | ||
9 | 387 | return ['Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price','Destination','Cost Center'] | ||
10 | 388 | |||
11 | 389 | def printAnalyticLines(self, analytic_lines): | 386 | def printAnalyticLines(self, analytic_lines): |
12 | 390 | res = [] | 387 | res = [] |
13 | 391 | # if additional analytic lines print them here. | 388 | # if additional analytic lines print them here. |
14 | @@ -412,12 +409,14 @@ | |||
15 | 412 | # TODO the multiplier is the value populated for no change in stock_move.price_unit | 409 | # TODO the multiplier is the value populated for no change in stock_move.price_unit |
16 | 413 | # TODO it probably should be 1 | 410 | # TODO it probably should be 1 |
17 | 414 | multiplier = 1.0000100000000001 | 411 | multiplier = 1.0000100000000001 |
18 | 412 | po_obj = self.pool.get('purchase.order') | ||
19 | 415 | pol_obj = self.pool.get('purchase.order.line') | 413 | pol_obj = self.pool.get('purchase.order.line') |
20 | 416 | prod_obj = self.pool.get('product.product') | 414 | prod_obj = self.pool.get('product.product') |
21 | 417 | uom_obj = self.pool.get('product.uom') | 415 | uom_obj = self.pool.get('product.uom') |
22 | 418 | po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)], order='line_number') | 416 | po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)], order='line_number') |
23 | 419 | po_lines = pol_obj.browse(self.cr, self.uid, po_line_ids) | 417 | po_lines = pol_obj.browse(self.cr, self.uid, po_line_ids) |
24 | 420 | report_lines = [] | 418 | report_lines = [] |
25 | 419 | order = po_obj.browse(self.cr, self.uid, po_id) | ||
26 | 421 | for line in po_lines: | 420 | for line in po_lines: |
27 | 422 | in_lines = self.getAllLineIN(line.id) | 421 | in_lines = self.getAllLineIN(line.id) |
28 | 423 | analytic_lines = self.getAnalyticLines(line) | 422 | analytic_lines = self.getAnalyticLines(line) |
29 | @@ -438,6 +437,10 @@ | |||
30 | 438 | # Display information of the initial reception | 437 | # Display information of the initial reception |
31 | 439 | if not same_product_same_uom: | 438 | if not same_product_same_uom: |
32 | 440 | report_line = { | 439 | report_line = { |
33 | 440 | 'order_ref': order.name or '', | ||
34 | 441 | 'order_created': order.date_order or '', | ||
35 | 442 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
36 | 443 | 'order_status': self._get_states().get(order.state, ''), | ||
37 | 441 | 'item': line.line_number or '', | 444 | 'item': line.line_number or '', |
38 | 442 | 'code': line.product_id.default_code or '', | 445 | 'code': line.product_id.default_code or '', |
39 | 443 | 'description': line.product_id.name or '', | 446 | 'description': line.product_id.name or '', |
40 | @@ -457,6 +460,10 @@ | |||
41 | 457 | 460 | ||
42 | 458 | for spsul in same_product_same_uom: | 461 | for spsul in same_product_same_uom: |
43 | 459 | report_line = { | 462 | report_line = { |
44 | 463 | 'order_ref': order.name or '', | ||
45 | 464 | 'order_created': order.date_order or '', | ||
46 | 465 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
47 | 466 | 'order_status': self._get_states().get(order.state, ''), | ||
48 | 460 | 'item': first_line and line.line_number or '', | 467 | 'item': first_line and line.line_number or '', |
49 | 461 | 'code': first_line and line.product_id.default_code or '', | 468 | 'code': first_line and line.product_id.default_code or '', |
50 | 462 | 'description': first_line and line.product_id.name or '', | 469 | 'description': first_line and line.product_id.name or '', |
51 | @@ -481,6 +488,10 @@ | |||
52 | 481 | 488 | ||
53 | 482 | for spl in same_product: | 489 | for spl in same_product: |
54 | 483 | report_line = { | 490 | report_line = { |
55 | 491 | 'order_ref': order.name or '', | ||
56 | 492 | 'order_created': order.date_order or '', | ||
57 | 493 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
58 | 494 | 'order_status': self._get_states().get(order.state, ''), | ||
59 | 484 | 'item': first_line and line.line_number or '', | 495 | 'item': first_line and line.line_number or '', |
60 | 485 | 'code': first_line and line.product_id.default_code or '', | 496 | 'code': first_line and line.product_id.default_code or '', |
61 | 486 | 'description': first_line and line.product_id.name or '', | 497 | 'description': first_line and line.product_id.name or '', |
62 | @@ -505,6 +516,10 @@ | |||
63 | 505 | for ol in other_product: | 516 | for ol in other_product: |
64 | 506 | prod_brw = prod_obj.browse(self.cr, self.uid, ol.get('product_id')) | 517 | prod_brw = prod_obj.browse(self.cr, self.uid, ol.get('product_id')) |
65 | 507 | report_line = { | 518 | report_line = { |
66 | 519 | 'order_ref': order.name or '', | ||
67 | 520 | 'order_created': order.date_order or '', | ||
68 | 521 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
69 | 522 | 'order_status': self._get_states().get(order.state, ''), | ||
70 | 508 | 'item': line.line_number or '', | 523 | 'item': line.line_number or '', |
71 | 509 | 'code': prod_brw.default_code or '', | 524 | 'code': prod_brw.default_code or '', |
72 | 510 | 'description': prod_brw.name or '', | 525 | 'description': prod_brw.name or '', |
73 | @@ -560,7 +575,7 @@ | |||
74 | 560 | return self.datas.get('report_header')[1] | 575 | return self.datas.get('report_header')[1] |
75 | 561 | 576 | ||
76 | 562 | def getPOLineHeaders(self): | 577 | def getPOLineHeaders(self): |
78 | 563 | return ['Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price','Destination','Cost Center'] | 578 | return ['Order Ref', 'Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price', 'Created', 'Confirmed Delivery', 'Status', 'Destination','Cost Center'] |
79 | 564 | 579 | ||
80 | 565 | 580 | ||
81 | 566 | 581 | ||
82 | 567 | 582 | ||
83 | === modified file 'msf_supply_doc_export/report/report_po_follow_up_xls.mako' | |||
84 | --- msf_supply_doc_export/report/report_po_follow_up_xls.mako 2014-11-07 10:52:52 +0000 | |||
85 | +++ msf_supply_doc_export/report/report_po_follow_up_xls.mako 2015-03-12 10:46:41 +0000 | |||
86 | @@ -81,6 +81,8 @@ | |||
87 | 81 | ## definition of the columns' size | 81 | ## definition of the columns' size |
88 | 82 | <% nb_of_columns = 12 %> | 82 | <% nb_of_columns = 12 %> |
89 | 83 | <Table x:FullColumns="1" x:FullRows="1"> | 83 | <Table x:FullColumns="1" x:FullRows="1"> |
90 | 84 | # Order name | ||
91 | 85 | <Column ss:AutoFitWidth="1" ss:Width="65" /> | ||
92 | 84 | # Item | 86 | # Item |
93 | 85 | <Column ss:AutoFitWidth="1" ss:Width="40" /> | 87 | <Column ss:AutoFitWidth="1" ss:Width="40" /> |
94 | 86 | # Code | 88 | # Code |
95 | @@ -101,6 +103,12 @@ | |||
96 | 101 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 103 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
97 | 102 | # IN Unit Price | 104 | # IN Unit Price |
98 | 103 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 105 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
99 | 106 | # Created (order) | ||
100 | 107 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
101 | 108 | # Delivery Confirmed (order) | ||
102 | 109 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
103 | 110 | # Status (order) | ||
104 | 111 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
105 | 104 | # Destination | 112 | # Destination |
106 | 105 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 113 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
107 | 106 | # Cost Center | 114 | # Cost Center |
108 | @@ -116,16 +124,6 @@ | |||
109 | 116 | <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell> | 124 | <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell> |
110 | 117 | <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell> | 125 | <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell> |
111 | 118 | </Row> | 126 | </Row> |
112 | 119 | <Row></Row> | ||
113 | 120 | <Row></Row> | ||
114 | 121 | |||
115 | 122 | % for o in objects: | ||
116 | 123 | |||
117 | 124 | <Row ss:AutoFitHeight="0" ss:Height="36"> | ||
118 | 125 | % for header in getHeaderLine(o): | ||
119 | 126 | <Cell ss:MergeAcross="1" ss:StyleID="poheader"><Data ss:Type="String">${header |x}</Data></Cell> | ||
120 | 127 | % endfor | ||
121 | 128 | </Row> | ||
122 | 129 | 127 | ||
123 | 130 | <Row ss:AutoFitHeight="1" > | 128 | <Row ss:AutoFitHeight="1" > |
124 | 131 | % for header in getPOLineHeaders(): | 129 | % for header in getPOLineHeaders(): |
125 | @@ -133,8 +131,11 @@ | |||
126 | 133 | % endfor | 131 | % endfor |
127 | 134 | </Row> | 132 | </Row> |
128 | 135 | 133 | ||
129 | 134 | % for o in objects: | ||
130 | 135 | |||
131 | 136 | % for line in getPOLines(o.id): | 136 | % for line in getPOLines(o.id): |
132 | 137 | <Row ss:AutoFitHeight="1"> | 137 | <Row ss:AutoFitHeight="1"> |
133 | 138 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell> | ||
134 | 138 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell> | 139 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell> |
135 | 139 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell> | 140 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell> |
136 | 140 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell> | 141 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell> |
137 | @@ -145,6 +146,9 @@ | |||
138 | 145 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell> | 146 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell> |
139 | 146 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell> | 147 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell> |
140 | 147 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell> | 148 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell> |
141 | 149 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell> | ||
142 | 150 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell> | ||
143 | 151 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell> | ||
144 | 148 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell> | 152 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell> |
145 | 149 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell> | 153 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell> |
146 | 150 | </Row> | 154 | </Row> |