Merge lp:~unifield-team/unifield-wm/uftp-315 into lp:unifield-wm

Proposed by jftempo
Status: Merged
Merged at revision: 2342
Proposed branch: lp:~unifield-team/unifield-wm/uftp-315
Merge into: lp:unifield-wm
Diff against target: 674 lines (+223/-133)
11 files modified
msf_outgoing/report/invoice.rml (+1/-1)
msf_supply_doc_export/msf_supply_doc_export.py (+57/-42)
msf_supply_doc_export/po_follow_up_menu.xml (+1/-1)
msf_supply_doc_export/report/report_po_follow_up.rml (+39/-36)
msf_supply_doc_export/report/report_po_follow_up_xls.mako (+58/-27)
msf_supply_doc_export/wizard/po_follow_up.py (+25/-20)
msf_supply_doc_export/wizard/po_follow_up_view.xml (+2/-2)
sales_followup/report/sale_follow_up_multi_report.rml (+1/-1)
sales_followup/report/sale_follow_up_multi_report_xls.mako (+2/-2)
stock_override/report/delivery_order.py (+16/-0)
stock_override/report/delivery_order.rml (+21/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/uftp-315
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+241056@code.launchpad.net
To post a comment you must log in.
2322. By Quentin THEURET @Amaris

UFTP-315 [FIX] Top line for report (see attachment) shows RFQ ref. This report is only for POs.

2323. By Quentin THEURET @Amaris

UFTP-315 [FIX] The References of the POs are hidden in the excel, please can this be formatted so they are displayed

2324. By Quentin THEURET @Amaris

UFTP-315 [FIX] When I have a PO (PO006) and receive 2 partial receptions (in both I change the unit price at reception) The unit price displayed is not correctly displayed in the report)

2325. By Quentin THEURET @Amaris

UFTP-315 [FIX] Display the backordered quantity on the remaining stock move

2326. By Quentin THEURET @Amaris

UFTP-315 [FIX] Filter the PO only on states that are displayed on Unifield

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'msf_outgoing/report/invoice.rml'
2--- msf_outgoing/report/invoice.rml 2014-09-26 08:44:15 +0000
3+++ msf_outgoing/report/invoice.rml 2014-11-07 15:09:49 +0000
4@@ -96,7 +96,7 @@
5 </para>
6
7 <!-- header: ref fields -->
8- <blockTable colWidths="120.0,120.0,150,150,292" style="HeaderInfos">
9+ <blockTable colWidths="100.0,220.0,170,170,172" style="HeaderInfos">
10 <tr>
11 <td>
12 <para style="HeaderInfosTitle">Our ref:</para>
13
14=== modified file 'msf_supply_doc_export/msf_supply_doc_export.py'
15--- msf_supply_doc_export/msf_supply_doc_export.py 2014-08-04 09:27:34 +0000
16+++ msf_supply_doc_export/msf_supply_doc_export.py 2014-11-07 15:09:49 +0000
17@@ -27,6 +27,7 @@
18 from report_webkit.webkit_report import WebKitParser as OldWebKitParser
19 from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport
20 from tools.translate import _
21+from purchase_override import PURCHASE_ORDER_STATE_SELECTION
22
23 import pooler
24 import time
25@@ -339,33 +340,31 @@
26
27
28 class po_follow_up_mixin(object):
29+
30+ def _get_states(self):
31+ states = {}
32+ for state_val, state_string in PURCHASE_ORDER_STATE_SELECTION:
33+ states[state_val] = state_string
34+ return states
35
36 def getHeaderLine(self,obj):
37 ''' format the header line for each PO object '''
38- states = {'sourced': 'Sourced', 'confirmed': 'Validated', 'confirmed_wait': 'Confirmed (waiting)', 'approved': 'Confirmed' }
39 po_header = []
40 po_header.append('Order ref: ' + obj.name)
41- po_header.append('Status: ' + states[obj.state])
42+ po_header.append('Status: ' + self._get_states().get(obj.state, ''))
43 po_header.append('Created: ' + obj.date_order)
44- po_header.append('Confirmed del date: ' + obj.delivery_confirmed_date)
45+ po_header.append('Confirmed delivery date: ' + obj.delivery_confirmed_date)
46 po_header.append('Nb items: ' + str(len(obj.order_line)))
47 po_header.append('Estimated amount: ' + str(obj.amount_total))
48- po_header.append('')
49- po_header.append('')
50- po_header.append('')
51- po_header.append('')
52- po_header.append('')
53- po_header.append('')
54 return po_header
55
56 def getHeaderLine2(self,obj):
57 ''' format the header line for each PO object '''
58- states = {'sourced': 'Sourced', 'confirmed': 'Validated', 'confirmed_wait': 'Confirmed (waiting)', 'approved': 'Confirmed' }
59 po_header = {}
60 po_header['ref'] = 'Order ref: ' + obj.name
61- po_header['status'] = 'Status: ' + states[obj.state]
62+ po_header['status'] = 'Status: ' + self._get_states().get(obj.state, '')
63 po_header['created'] = 'Created: ' + obj.date_order
64- po_header['deldate'] = 'Confirmed del date: ' + obj.delivery_confirmed_date
65+ po_header['deldate'] = 'Confirmed delivery date: ' + obj.delivery_confirmed_date
66 po_header['items'] = 'Nb items: ' + str(len(obj.order_line))
67 po_header['amount'] = 'Estimated amount: ' + str(obj.amount_total)
68 line = po_header['ref'] + po_header['status'] + po_header['created'] + po_header['deldate'] + po_header['items'] + po_header['amount']
69@@ -393,39 +392,47 @@
70 # TODO it probably should be 1
71 multiplier = 1.0000100000000001
72 pol_obj = self.pool.get('purchase.order.line')
73- po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)])
74+ prod_obj = self.pool.get('product.product')
75+ po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)], order='line_number')
76 po_lines = pol_obj.browse(self.cr, self.uid, po_line_ids)
77 report_lines = []
78 for line in po_lines:
79+ sort_key = float(line.line_number*1000)
80 report_line = {}
81 inline_in = self.getInlineIN(line.id)
82 analytic_lines = self.getAnalyticLines(line)
83- report_line['sort_key'] = float(line.line_number)
84+ other_ins = []
85+ if inline_in:
86+ other_ins = self.getOtherINs(line.id, inline_in.get('id'))
87+ report_line['sort_key'] = sort_key
88 report_line['item'] = line.line_number or ''
89 report_line['code'] = line.product_id.default_code or ''
90 report_line['description'] = line.product_id.name or ''
91 report_line['qty_ordered'] = line.product_qty or ''
92 report_line['uom'] = line.product_uom.name or ''
93- report_line['qty_received'] = inline_in.get('product_qty','')
94+ report_line['qty_received'] = inline_in.get('state') == 'done' and inline_in.get('product_qty','') or '0.00'
95 report_line['in'] = inline_in.get('name','') or ''
96- if report_line['in'] == '':
97- report_line['qty_backordered'] = report_line['qty_ordered']
98+ if inline_in.get('backorder_id') and inline_in.get('state') != 'done':
99+ report_line['qty_backordered'] = inline_in.get('product_qty', '')
100 else:
101 report_line['qty_backordered'] = ''
102 report_line['unit_price'] = line.price_unit or ''
103 if inline_in.get('price_unit') and inline_in.get('price_unit') <> multiplier:
104- report_line['in_unit_price'] = inline_in.get('price_unit') * line.price_unit
105+ report_line['in_unit_price'] = inline_in.get('price_unit')
106 else:
107 report_line['in_unit_price'] = ''
108- report_line['in_unit_price'] = ''
109+# report_line['in_unit_price'] = ''
110 report_line['destination'] = analytic_lines[0].get('destination')
111 report_line['cost_centre'] = analytic_lines[0].get('cost_center')
112 report_lines.append(report_line)
113+ if inline_in.get('state') != 'done':
114+ report_line['in_unit_price'] = ''
115
116 # if additional analytic lines print them here.
117 for (index, analytic_line) in list(enumerate(analytic_lines))[1:]:
118 report_line = {}
119- report_line['sort_key'] = line.line_number + (float(index) / 10)
120+ sort_key += 1
121+ report_line['sort_key'] = sort_key
122 report_line['item'] = ''
123 report_line['code'] = ''
124 report_line['description'] = ''
125@@ -441,33 +448,41 @@
126 report_lines.append(report_line)
127
128 # check if there are additional INs for this line
129- if inline_in:
130- other_ins = self.getOtherINs(line.id, inline_in.get('id'))
131+ if other_ins:
132 for other_in in other_ins:
133 report_line = {}
134- backorder = other_in.get('backorder_id')
135- report_line['sort_key'] = line.line_number + (float(other_in.get('id')) / 100)
136+ backorder = inline_in.get('backorder_id') and other_in.get('picking_id') == inline_in.get('backorder_id')
137+ sort_key += 1
138+ report_line['sort_key'] = sort_key
139+
140+ # Product is changed
141+ if other_in.get('product_id') and other_in.get('product_id') != line.product_id.id:
142+ prod_brw = prod_obj.browse(self.cr, self.uid, other_in.get('product_id'))
143+ report_line['code'] = prod_brw.default_code
144+ report_line['description'] = prod_brw.name
145+ else:
146+ report_line['code'] = ''
147+ report_line['description'] = ''
148+
149 report_line['item'] = ''
150- report_line['code'] = ''
151- report_line['description'] = ''
152 report_line['qty_ordered'] = ''
153 report_line['uom'] = ''
154- if backorder:
155- report_line['qty_received'] = ''
156- else:
157- report_line['qty_received'] = other_in.get('product_qty','')
158+# if backorder and inline_in.get('state') != 'done':
159+# report_line['qty_received'] = other_in.get('product_qty', '')
160+# report_line['qty_backordered'] = inline_in.get('product_qty', '')
161+# else:
162+ report_line['qty_received'] = other_in.get('product_qty','')
163+ report_line['qty_backordered'] = ''
164 report_line['in'] = other_in.get('name','')
165- if backorder:
166- report_line['qty_backordered'] = other_in.get('product_qty','')
167- else:
168- report_line['qty_backordered'] = ''
169 report_line['unit_price'] = line.price_unit or ''
170- if inline_in.get('price_unit') and inline_in.get('price_unit') <> multiplier:
171- report_line['in_unit_price'] = inline_in.get('price_unit') * line.price_unit
172+ if other_in.get('price_unit') and other_in.get('price_unit') <> multiplier:
173+ report_line['in_unit_price'] = other_in.get('price_unit')
174 else:
175 report_line['in_unit_price'] = ''
176- report_line['destination'] = ''
177- report_line['cost_centre'] = ''
178+ report_line['destination'] = analytic_lines[0].get('destination')
179+ report_line['cost_centre'] = analytic_lines[0].get('cost_center')
180+ if other_in.get('state') != 'done':
181+ report_line['in_unit_price'] = ''
182 report_lines.append(report_line)
183
184 # sort the list for presentation in excel
185@@ -489,12 +504,12 @@
186
187 def getInlineIN(self,po_line_id):
188 sm_obj = self.pool.get('stock.move')
189- self.cr.execute(''' select sm.id, sp.name, sm.product_qty, sm.product_uom, sm.price_unit, sm.state
190+ self.cr.execute(''' select sm.id, sp.name, sm.product_qty, sm.product_uom, sm.price_unit, sm.state, sp.backorder_id
191 from stock_move sm, stock_picking sp
192 where sm.purchase_line_id = %s
193 and sm.type = 'in'
194 and sm.picking_id = sp.id
195- order by sm.id asc limit 1''' % (po_line_id))
196+ order by sp.name, sm.id asc limit 1''' % (po_line_id))
197 row = self.cr.dictfetchall()
198 if row:
199 return row[0]
200@@ -504,13 +519,13 @@
201
202 def getOtherINs(self,po_line_id,exclude_id):
203 sm_obj = self.pool.get('stock.move')
204- self.cr.execute(''' select sm.id, sp.name, sm.product_qty, sm.product_uom, sm.price_unit, sm.state, sp.backorder_id
205+ self.cr.execute(''' select sm.id, sp.name, sm.product_qty, sm.product_id, sm.product_uom, sm.price_unit, sm.state, sm.picking_id
206 from stock_move sm, stock_picking sp
207 where sm.purchase_line_id = %s
208 and sm.type = 'in'
209 and sm.picking_id = sp.id
210 and sm.id <> %s
211- order by sm.id asc''' % (po_line_id,exclude_id))
212+ order by sp.name, sm.id asc''' % (po_line_id,exclude_id))
213 rows = self.cr.dictfetchall()
214 if rows:
215 return rows
216
217=== modified file 'msf_supply_doc_export/po_follow_up_menu.xml'
218--- msf_supply_doc_export/po_follow_up_menu.xml 2014-05-23 13:22:27 +0000
219+++ msf_supply_doc_export/po_follow_up_menu.xml 2014-11-07 15:09:49 +0000
220@@ -3,7 +3,7 @@
221 <data>
222
223 <record id="po_follow_up_menu" model="ir.actions.act_window">
224- <field name="name">PO Follow Up</field>
225+ <field name="name">PO Follow Up per Supplier</field>
226 <field name="res_model">po.follow.up</field>
227 <field name="view_type">form</field>
228 <field name="view_mode">tree,graph</field>
229
230=== modified file 'msf_supply_doc_export/report/report_po_follow_up.rml'
231--- msf_supply_doc_export/report/report_po_follow_up.rml 2014-06-26 15:11:30 +0000
232+++ msf_supply_doc_export/report/report_po_follow_up.rml 2014-11-07 15:09:49 +0000
233@@ -17,6 +17,7 @@
234 <lineStyle kind="LINEAFTER" colorName="#000000" start="0,0" stop="0,-1"/>
235 <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
236 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
237+ <blockBackground colorName="#e6e6e6" start="0,0" stop="-1,0"/>
238 </blockTableStyle>
239 <blockTableStyle id="Tableau3">
240 <blockAlignment value="LEFT"/>
241@@ -29,10 +30,12 @@
242 <initialize>
243 <paraStyle name="all" alignment="justify"/>
244 </initialize>
245- <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="16.0" leading="20" alignment="CENTER" backColor="#e6e6e6"/>
246+ <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="16.0" leading="20" alignment="CENTER" />
247 <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10"/>
248 <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
249 <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
250+ <paraStyle name="P4Center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
251+ <paraStyle name="P4Left" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
252 <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10"/>
253 <paraStyle name="Standard" fontName="Helvetica"/>
254 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
255@@ -77,7 +80,7 @@
256 <td><para style="P2">[[ getHeaderLine(o)[5] ]]</para></td>
257 </tr>
258 </blockTable>
259- <blockTable colWidths="25.0,175.0,160.0,40.0,50.0,50.0,100.0,100.0,50.0,50.0,50.0,50.0" style="Tableau3" >
260+ <blockTable colWidths="25.0,80.0,185.0,40.0,50.0,50.0,85.0,100.0,70.0,70.0,60.0,85.0" style="Tableau3" >
261 <tr>
262 <td>
263 <para style="P3">Item</para>
264@@ -119,40 +122,40 @@
265 <tr>
266 <para style="P4">[[ repeatIn(getPOLines(o.id), 'line') ]]</para>
267 <td>
268- <para style="P4">[[ line['item'] ]]</para>
269- </td>
270- <td>
271- <para style="P4">[[ line['code'] ]]</para>
272- </td>
273- <td>
274- <para style="P4">[[ line['description'] ]]</para>
275- </td>
276- <td>
277- <para style="P4">[[ line['qty_ordered'] ]]</para>
278- </td>
279- <td>
280- <para style="P4">[[ line['uom'] ]]</para>
281- </td>
282- <td>
283- <para style="P4">[[ line['qty_received'] ]]</para>
284- </td>
285- <td>
286- <para style="P4">[[ line['in'] ]]</para>
287- </td>
288- <td>
289- <para style="P4">[[ line['qty_backordered'] ]]</para>
290- </td>
291- <td>
292- <para style="P4">[[ line['unit_price'] ]]</para>
293- </td>
294- <td>
295- <para style="P4">[[ line['in_unit_price'] ]]</para>
296- </td>
297- <td>
298- <para style="P4">[[ line['destination'] ]]</para>
299- </td>
300- <td>
301- <para style="P4">[[ line['cost_centre'] ]]</para>
302+ <para style="P4Center">[[ line['item'] ]]</para>
303+ </td>
304+ <td>
305+ <para style="P4Left">[[ line['code'] ]]</para>
306+ </td>
307+ <td>
308+ <para style="P4Left">[[ line['description'] ]]</para>
309+ </td>
310+ <td>
311+ <para style="P4Center">[[ line['qty_ordered'] ]]</para>
312+ </td>
313+ <td>
314+ <para style="P4Center">[[ line['uom'] ]]</para>
315+ </td>
316+ <td>
317+ <para style="P4Center">[[ line['qty_received'] ]]</para>
318+ </td>
319+ <td>
320+ <para style="P4Center">[[ line['in'] ]]</para>
321+ </td>
322+ <td>
323+ <para style="P4Center">[[ line['qty_backordered'] ]]</para>
324+ </td>
325+ <td>
326+ <para style="P4Center">[[ line['unit_price'] ]]</para>
327+ </td>
328+ <td>
329+ <para style="P4Center">[[ line['in_unit_price'] ]]</para>
330+ </td>
331+ <td>
332+ <para style="P4Center">[[ line['destination'] ]]</para>
333+ </td>
334+ <td>
335+ <para style="P4Center">[[ line['cost_centre'] ]]</para>
336 </td>
337 </tr>
338
339
340=== modified file 'msf_supply_doc_export/report/report_po_follow_up_xls.mako'
341--- msf_supply_doc_export/report/report_po_follow_up_xls.mako 2014-06-26 15:11:30 +0000
342+++ msf_supply_doc_export/report/report_po_follow_up_xls.mako 2014-11-07 15:09:49 +0000
343@@ -81,46 +81,60 @@
344 ## definition of the columns' size
345 <% nb_of_columns = 12 %>
346 <Table x:FullColumns="1" x:FullRows="1">
347-<Column ss:AutoFitWidth="1" ss:Width="120" />
348-<Column ss:AutoFitWidth="1" ss:Width="120" />
349-<Column ss:AutoFitWidth="1" ss:Width="300" />
350-<Column ss:AutoFitWidth="1" ss:Width="80" />
351-<Column ss:AutoFitWidth="1" ss:Width="80" />
352-<Column ss:AutoFitWidth="1" ss:Width="80" />
353-<Column ss:AutoFitWidth="1" ss:Width="80" />
354-<Column ss:AutoFitWidth="1" ss:Width="80" />
355-<Column ss:AutoFitWidth="1" ss:Width="80" />
356-<Column ss:AutoFitWidth="1" ss:Width="80" />
357-<Column ss:AutoFitWidth="1" ss:Width="80" />
358-<Column ss:AutoFitWidth="1" ss:Width="80" />
359+ # Item
360+ <Column ss:AutoFitWidth="1" ss:Width="40" />
361+ # Code
362+ <Column ss:AutoFitWidth="1" ss:Width="81" />
363+ # Description
364+ <Column ss:AutoFitWidth="1" ss:Width="161" />
365+ # Qty ordered
366+ <Column ss:AutoFitWidth="1" ss:Width="57" />
367+ # UoM
368+ <Column ss:AutoFitWidth="1" ss:Width="65" />
369+ # Qty received
370+ <Column ss:AutoFitWidth="1" ss:Width="80" />
371+ # IN
372+ <Column ss:AutoFitWidth="1" ss:Width="60" />
373+ # Qty backorder
374+ <Column ss:AutoFitWidth="1" ss:Width="58" />
375+ # Unit Price
376+ <Column ss:AutoFitWidth="1" ss:Width="95" />
377+ # IN Unit Price
378+ <Column ss:AutoFitWidth="1" ss:Width="95" />
379+ # Destination
380+ <Column ss:AutoFitWidth="1" ss:Width="95" />
381+ # Cost Center
382+ <Column ss:AutoFitWidth="1" ss:Width="95" />
383
384 <Row>
385- <Cell ss:StyleID="mainheader"><Data ss:Type="String">${getRunParms()['title'] or '' |x}</Data></Cell>
386- <Cell ss:StyleID="mainheader"><Data ss:Type="String">Report run date: ${getRunParms()['run_date'] or '' |x}</Data></Cell>
387- <Cell ss:StyleID="mainheader"><Data ss:Type="String">PO date from: ${getRunParms()['date_from'] or ''|x}</Data></Cell>
388- <Cell ss:StyleID="mainheader"><Data ss:Type="String">PO date to: ${getRunParms()['date_thru'] or '' |x}</Data></Cell>
389- <Cell ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell>
390- <Cell ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell>
391+ <Cell ss:MergeAcross="11" ss:StyleID="mainheader"><Data ss:Type="String">${getRunParms()['title'] or '' |x}</Data></Cell>
392+</Row>
393+<Row ss:AutoFitHeight="1">
394+ <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">Report run date: ${getRunParms()['run_date'] or '' |x}</Data></Cell>
395+ <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">PO date from: ${getRunParms()['date_from'] or ''|x}</Data></Cell>
396+ <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">PO date to: ${getRunParms()['date_thru'] or '' |x}</Data></Cell>
397+ <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell>
398+ <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell>
399 </Row>
400 <Row></Row>
401 <Row></Row>
402
403 % for o in objects:
404
405- <Row>
406+ <Row ss:AutoFitHeight="0" ss:Height="36">
407 % for header in getHeaderLine(o):
408- <Cell ss:StyleID="poheader"><Data ss:Type="String">${header |x}</Data></Cell>
409+ <Cell ss:MergeAcross="1" ss:StyleID="poheader"><Data ss:Type="String">${header |x}</Data></Cell>
410 % endfor
411 </Row>
412
413- <Row>
414+ <Row ss:AutoFitHeight="1" >
415 % for header in getPOLineHeaders():
416 <Cell ss:StyleID="header"><Data ss:Type="String">${header}</Data></Cell>
417 % endfor
418 </Row>
419
420 % for line in getPOLines(o.id):
421- <Row>
422+ <Row ss:AutoFitHeight="1">
423 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell>
424 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell>
425 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell>
426@@ -135,14 +149,31 @@
427 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell>
428 </Row>
429 % endfor
430- <Row>
431- <Cell ss:StyleID="line"><Data ss:Type="String"></Data></Cell>
432- <Cell ss:StyleID="line"><Data ss:Type="String"></Data></Cell>
433- </Row>
434 % endfor
435
436 </Table>
437-<x:WorksheetOptions/>
438+<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
439+ <PageSetup>
440+ <Layout x:Orientation="Landscape"/>
441+ <Header x:Data="&amp;C&amp;&quot;Arial,Bold&quot;&amp;14${getRunParms()['title'] or '' |x}"/>
442+ <Footer x:Data="Page &amp;P of &amp;N"/>
443+ </PageSetup>
444+ <Print>
445+ <ValidPrinterInfo/>
446+ <PaperSizeIndex>9</PaperSizeIndex>
447+ <HorizontalResolution>600</HorizontalResolution>
448+ <VerticalResolution>600</VerticalResolution>
449+ </Print>
450+ <Selected/>
451+ <Panes>
452+ <Pane>
453+ <Number>3</Number>
454+ <ActiveRow>17</ActiveRow>
455+ </Pane>
456+ </Panes>
457+ <ProtectObjects>False</ProtectObjects>
458+ <ProtectScenarios>False</ProtectScenarios>
459+</WorksheetOptions>
460 </ss:Worksheet>
461
462 </Workbook>
463
464=== modified file 'msf_supply_doc_export/wizard/po_follow_up.py'
465--- msf_supply_doc_export/wizard/po_follow_up.py 2014-10-06 11:37:02 +0000
466+++ msf_supply_doc_export/wizard/po_follow_up.py 2014-11-07 15:09:49 +0000
467@@ -27,24 +27,23 @@
468 import time
469 from datetime import datetime
470
471+PURCHASE_ORDER_STATE_SELECTION = [
472+ ('draft', 'Draft'),
473+ ('sourced', 'Sourced'),
474+ ('confirmed', 'Validated'),
475+ ('confirmed_wait', 'Confirmed (waiting)'),
476+ ('approved', 'Confirmed'),
477+ ('done', 'Closed'),
478+ ('cancel', 'Cancelled'),
479+]
480
481 class po_follow_up(osv.osv_memory):
482 _name = 'po.follow.up'
483 _description = 'PO Follow up report wizard'
484-
485- STATE_SELECTION = [
486- ('sourced', 'Sourced'),
487- ('confirmed', 'Validated'),
488- ('confirmed_wait', 'Confirmed (waiting)'),
489- ('approved', 'Confirmed'),
490- ]
491-
492- STATES = {'sourced': 'Sourced','confirmed': 'Validated','confirmed_wait': 'Confirmed waiting','approved':'Confirmed'}
493-
494-
495+
496 _columns = {
497 'po_id':fields.many2one('purchase.order',string="Order Reference", help="Unique number of the Purchase Order. Optional", required=False),
498- 'state': fields.selection(STATE_SELECTION, 'State', help="The state of the purchase order. Optional", select=True, required=False),
499+ 'state': fields.selection(PURCHASE_ORDER_STATE_SELECTION, 'State', help="The state of the purchase order. Optional", select=True, required=False),
500 'po_date_from':fields.date("PO date from", required="False"),
501 'po_date_thru':fields.date("PO date to", required="False"),
502 'partner_id':fields.many2one('res.partner', 'Supplier', required=False),
503@@ -53,7 +52,6 @@
504 'background_time': fields.integer('Number of second before background processing'),
505 }
506
507-
508 _defaults = {
509 'export_format': lambda *a: 'xls',
510 'background_time': lambda *a: 200,
511@@ -61,10 +59,19 @@
512
513 def button_validate(self, cr, uid, ids, context=None):
514 wiz = self.browse(cr,uid,ids)[0]
515-
516- domain = []
517- states = {'sourced': 'Sourced','confirmed': 'Validated','confirmed_wait': 'Confirmed waiting','approved':'Confirmed'}
518- report_parms = {'title':'MULTIPLE PURCHASE ORDER FOLLOW-UP','run_date': time.strftime("%d/%m/%Y"), 'date_from': '', 'date_thru': '','state': '', 'supplier':'' }
519+
520+ domain = [('rfq_ok', '=', False)]
521+ states = {}
522+ for state_val, state_string in PURCHASE_ORDER_STATE_SELECTION:
523+ states[state_val] = state_string
524+ report_parms = {
525+ 'title': 'PO Follow Up per Supplier',
526+ 'run_date': time.strftime("%d/%m/%Y"),
527+ 'date_from': '',
528+ 'date_thru': '',
529+ 'state': '',
530+ 'supplier':''
531+ }
532
533 # PO number
534 if wiz.po_id:
535@@ -74,8 +81,6 @@
536 if wiz.state:
537 domain.append(('state','=', wiz.state))
538 report_parms['state'] = states[wiz.state]
539- else:
540- domain.append(('state','in',['sourced','confirmed','confirmed_wait','approved']))
541
542 # Dates
543 if wiz.po_date_from:
544@@ -106,7 +111,7 @@
545 return True
546
547 report_header = []
548- report_header.append('MULTIPLE PURCHASE ORDER FOLLOW-UP')
549+ report_header.append(report_parms['title'])
550
551 report_header_line2 = ''
552 if wiz.partner_id:
553
554=== modified file 'msf_supply_doc_export/wizard/po_follow_up_view.xml'
555--- msf_supply_doc_export/wizard/po_follow_up_view.xml 2014-06-25 13:40:47 +0000
556+++ msf_supply_doc_export/wizard/po_follow_up_view.xml 2014-11-07 15:09:49 +0000
557@@ -8,8 +8,8 @@
558 <field name="type">form</field>
559 <field name="arch" type="xml">
560 <form string="Purchase Order Follow Up Report">
561- <field name="po_id" colspan="2" />
562- <field name="state" colspan="2" /> <!-- note need to exclude draft -->
563+ <field name="po_id" colspan="2" domain="[('rfq_ok', '=', False)]" />
564+ <field name="state" colspan="2" />
565 <field name="po_date_from" colspan="2" /> <!-- need to do from / though on dates -->
566 <field name="po_date_thru" colspan="2" />
567 <field name="partner_id" colspan="2" />
568
569=== modified file 'sales_followup/report/sale_follow_up_multi_report.rml'
570--- sales_followup/report/sale_follow_up_multi_report.rml 2014-09-22 09:18:42 +0000
571+++ sales_followup/report/sale_follow_up_multi_report.rml 2014-11-07 15:09:49 +0000
572@@ -228,7 +228,7 @@
573 <para style="Lines"><i>Packing</i></para>
574 </td>
575 <td>
576- <para style="Lines"><i>Qty backorder</i></para>
577+ <para style="Lines"><i>Qty to deliver</i></para>
578 </td>
579 <td>
580 <para style="Lines"><i>Transport</i></para>
581
582=== modified file 'sales_followup/report/sale_follow_up_multi_report_xls.mako'
583--- sales_followup/report/sale_follow_up_multi_report_xls.mako 2014-09-24 10:20:10 +0000
584+++ sales_followup/report/sale_follow_up_multi_report_xls.mako 2014-11-07 15:09:49 +0000
585@@ -168,7 +168,7 @@
586 <Column ss:AutoFitWidth="1" ss:Width="68.25" />
587 ## Packing
588 <Column ss:AutoFitWidth="1" ss:Width="60.25" />
589- ## Qty backorder
590+ ## Qty to deliver
591 <Column ss:AutoFitWidth="1" ss:Width="50.5" />
592 ## Transport
593 <Column ss:AutoFitWidth="1" ss:Width="53.5" />
594@@ -250,7 +250,7 @@
595 _('Qty delivered'),
596 _('UoM delivered'),
597 _('Packing'),
598- _('Qty backorder'),
599+ _('Qty to deliver'),
600 _('Transport'),
601 _('Transport file'),
602 _('ETA'),
603
604=== modified file 'stock_override/report/delivery_order.py'
605--- stock_override/report/delivery_order.py 2013-09-12 15:10:10 +0000
606+++ stock_override/report/delivery_order.py 2014-11-07 15:09:49 +0000
607@@ -30,6 +30,7 @@
608 'time': time,
609 'get_selec': self.get_selection,
610 'get_address': self.get_address,
611+ 'get_state': self.get_state,
612 })
613
614 def get_selection(self, o, field):
615@@ -51,6 +52,21 @@
616 '''
617 return self.pool.get('res.partner.address').name_get(self.cr, self.uid, [addr_id])[0][1]
618
619+ def get_state(self, state):
620+ if not state:
621+ return ''
622+ states = {
623+ 'draft': 'Draft',
624+ 'auto': 'Waiting',
625+ 'confirmed': 'Confirmed',
626+ 'assigned': 'Available',
627+ 'shipped': 'Available Shipped',
628+ 'done': 'Closed',
629+ 'cancel': 'Cancelled',
630+ 'import': 'Import in progress',
631+ }
632+ return states.get(state, '')
633+
634 report_sxw.report_sxw('report.delivery.order','stock.picking','addons/stock_override/report/delivery_order.rml',parser=delivery_order, header=False)
635
636 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
637
638=== modified file 'stock_override/report/delivery_order.rml'
639--- stock_override/report/delivery_order.rml 2013-10-09 14:14:28 +0000
640+++ stock_override/report/delivery_order.rml 2014-11-07 15:09:49 +0000
641@@ -143,12 +143,32 @@
642 <para style="Header">[[ picking.reason_type_id and picking.reason_type_id.name or '' ]]</para>
643 </td>
644 <td>
645- <para style="HeaderRight">Warehouse : </para>
646+ <para style="HeaderRight">Warehouse :</para>
647 </td>
648 <td>
649 <para style="Header">[[ picking.warehouse_id and picking.warehouse_id.name or '' ]]</para>
650 </td>
651 </tr>
652+ <tr>
653+ <td>
654+ <para style="HeaderRight">State :</para>
655+ </td>
656+ <td>
657+ <para style="Header">[[ get_state(picking.state) ]]</para>
658+ </td>
659+ <td>
660+ <para style="HeaderRight"></para>
661+ </td>
662+ <td>
663+ <para style="Header"></para>
664+ </td>
665+ <td>
666+ <para style="HeaderRight"></para>
667+ </td>
668+ <td>
669+ <para style="Header"></para>
670+ </td>
671+ </tr>
672 </blockTable>
673
674 <para style="Header">

Subscribers

People subscribed via source and target branches