Merge lp:~camptocamp/purchase-report/purchase_report_carriage_return_vre into lp:~purchase-core-editors/purchase-report/7.0

Proposed by Vincent Renaville@camptocamp
Status: Merged
Merged at revision: 17
Proposed branch: lp:~camptocamp/purchase-report/purchase_report_carriage_return_vre
Merge into: lp:~purchase-core-editors/purchase-report/7.0
Diff against target: 251 lines (+51/-23)
4 files modified
purchase_order_webkit/report/purchase_order.mako (+9/-2)
purchase_order_webkit/report/request_quotation.mako (+17/-10)
purchase_order_webkit_with_notes/report/purchase_order.mako (+9/-2)
purchase_order_webkit_with_notes/report/request_quotation.mako (+16/-9)
To merge this branch: bzr merge lp:~camptocamp/purchase-report/purchase_report_carriage_return_vre
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) Approve
Guewen Baconnier @ Camptocamp Approve
Yannick Vaucher @ Camptocamp code review, no test Approve
Review via email: mp+214030@code.launchpad.net

Description of the change

This add the possibility to add carriage return in the name of the product description.

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

The name is mandatory, so you can simplify this:
    ${line.name and line.name.replace('\n','<br/>') or '' | n}
by that:
    ${line.name.replace('\n','<br/>') | n}

review: Needs Fixing
18. By Yannick Vaucher @ Camptocamp

remove unecessary line.name check as it is mandatory field

19. By Yannick Vaucher @ Camptocamp

purchase_order_webkit_with_notes - remove unecessary line.name check as it is mandatory field

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Fixed previous 'need fixing'.

The change LGTM

As a side note, it seems there is an extra <tr> opening tag at lines 94, 109, 221 and 236 but this is unreleated to this MP thus I approve it.

review: Approve (code review, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase_order_webkit/report/purchase_order.mako'
2--- purchase_order_webkit/report/purchase_order.mako 2014-01-22 10:39:22 +0000
3+++ purchase_order_webkit/report/purchase_order.mako 2014-04-07 16:14:32 +0000
4@@ -179,27 +179,34 @@
5 }
6 td.main_col1 {
7 text-align:left;
8+ vertical-align:top;
9 }
10 .main_col2 {
11 width: 10%;
12+ vertical-align:top;
13 }
14 .main_col3 {
15 width: 10%;
16 text-align:center;
17+ vertical-align:top;
18 }
19 .main_col6 {
20 width: 10%;
21+ vertical-align:top;
22 }
23 .main_col4 {
24 width: 10%;
25 text-align:right;
26+ vertical-align:top;
27 }
28 .main_col5 {
29 width: 7%;
30 text-align:left;
31+ vertical-align:top;
32 }
33 .main_col7 {
34 width: 13%;
35+ vertical-align:top;
36 }
37
38
39@@ -297,12 +304,12 @@
40 <div class="nobreak">
41 <table style="width:100%">
42 <tr>
43- <td class="main_col1">${line.name}</td>
44+ <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
45 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>
46 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
47 <td class="amount main_col4">${line.product_qty}</td>
48 <td class="main_col5">${line.product_uom.name}</td>
49- <td class="amount main col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
50+ <td class="amount main_col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
51 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>
52 </tr>
53 </table>
54
55=== modified file 'purchase_order_webkit/report/request_quotation.mako'
56--- purchase_order_webkit/report/request_quotation.mako 2014-01-10 14:52:43 +0000
57+++ purchase_order_webkit/report/request_quotation.mako 2014-04-07 16:14:32 +0000
58@@ -179,27 +179,34 @@
59 }
60 td.main_col1 {
61 text-align:left;
62+ vertical-align:top;
63 }
64 .main_col2 {
65 width: 10%;
66+ vertical-align:top;
67 }
68 .main_col3 {
69 width: 10%;
70 text-align:center;
71+ vertical-align:top;
72 }
73 .main_col6 {
74 width: 10%;
75+ vertical-align:top;
76 }
77 .main_col4 {
78 width: 10%;
79 text-align:right;
80+ vertical-align:top;
81 }
82 .main_col5 {
83 width: 7%;
84 text-align:left;
85+ vertical-align:top;
86 }
87 .main_col7 {
88 width: 13%;
89+ vertical-align:top;
90 }
91
92
93@@ -263,9 +270,9 @@
94 <tr>
95 <th class="list_main_headers" style="width: 100%">
96 <table style="width:100%">
97- <th>${_("Description")}</th>
98- <th>${_("Expected Date")}</th>
99- <th class="amount">${_("Qty")}</th>
100+ <th class="main_col1">${_("Description")}</th>
101+ <th class="main_col3">${_("Expected Date")}</th>
102+ <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
103 </tr>
104 </table>
105 </th>
106@@ -277,13 +284,13 @@
107 <div class="nobreak">
108 <table style="width:100%">
109 <tr>
110- %for line in purch.order_line :
111- <tr class="line">
112- <td>${line.name}</td>
113- <td>${formatLang(line.date_planned, date=True)}</td>
114- <td class="amount">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
115- </tr>
116- %endfor
117+ %for line in purch.order_line :
118+ <tr class="line">
119+ <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
120+ <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
121+ <td class="amount main_col4">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
122+ </tr>
123+ %endfor
124 </table>
125 </div>
126 </td>
127
128=== modified file 'purchase_order_webkit_with_notes/report/purchase_order.mako'
129--- purchase_order_webkit_with_notes/report/purchase_order.mako 2014-01-22 10:39:22 +0000
130+++ purchase_order_webkit_with_notes/report/purchase_order.mako 2014-04-07 16:14:32 +0000
131@@ -179,27 +179,34 @@
132 }
133 td.main_col1 {
134 text-align:left;
135+ vertical-align:top;
136 }
137 .main_col2 {
138 width: 10%;
139+ vertical-align:top;
140 }
141 .main_col3 {
142 width: 10%;
143 text-align:center;
144+ vertical-align:top;
145 }
146 .main_col6 {
147 width: 10%;
148+ vertical-align:top;
149 }
150 .main_col4 {
151 width: 10%;
152 text-align:right;
153+ vertical-align:top;
154 }
155 .main_col5 {
156 width: 7%;
157 text-align:left;
158+ vertical-align:top;
159 }
160 .main_col7 {
161 width: 13%;
162+ vertical-align:top;
163 }
164
165
166@@ -300,12 +307,12 @@
167 <div class="nobreak">
168 <table style="width:100%">
169 <tr>
170- <td class="main_col1">${line.name}</td>
171+ <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
172 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>
173 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
174 <td class="amount main_col4">${line.product_qty}</td>
175 <td class="main_col5">${line.product_uom.name}</td>
176- <td class="amount main col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
177+ <td class="amount main_col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
178 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>
179 </tr>
180 </table>
181
182=== modified file 'purchase_order_webkit_with_notes/report/request_quotation.mako'
183--- purchase_order_webkit_with_notes/report/request_quotation.mako 2014-01-17 15:26:14 +0000
184+++ purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-07 16:14:32 +0000
185@@ -179,27 +179,34 @@
186 }
187 td.main_col1 {
188 text-align:left;
189+ vertical-align:top;
190 }
191 .main_col2 {
192 width: 10%;
193+ vertical-align:top;
194 }
195 .main_col3 {
196 width: 10%;
197 text-align:center;
198+ vertical-align:top;
199 }
200 .main_col6 {
201 width: 10%;
202+ vertical-align:top;
203 }
204 .main_col4 {
205 width: 10%;
206 text-align:right;
207+ vertical-align:top;
208 }
209 .main_col5 {
210 width: 7%;
211 text-align:left;
212+ vertical-align:top;
213 }
214 .main_col7 {
215 width: 13%;
216+ vertical-align:top;
217 }
218
219
220@@ -266,9 +273,9 @@
221 <tr>
222 <th class="list_main_headers" style="width: 100%">
223 <table style="width:100%">
224- <th>${_("Description")}</th>
225- <th>${_("Expected Date")}</th>
226- <th class="amount">${_("Qty")}</th>
227+ <th class="main_col1">${_("Description")}</th>
228+ <th class="main_col3">${_("Expected Date")}</th>
229+ <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
230 </tr>
231 </table>
232 </th>
233@@ -280,12 +287,12 @@
234 <div class="nobreak">
235 <table style="width:100%">
236 <tr>
237- %for line in purch.order_line :
238- <tr class="line">
239- <td>${line.name}</td>
240- <td>${formatLang(line.date_planned, date=True)}</td>
241- <td class="amount">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
242- </tr>
243+ %for line in purch.order_line :
244+ <tr class="line">
245+ <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
246+ <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
247+ <td class="amount main_col4">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
248+ </tr>
249 %endfor
250 </table>
251 </div>

Subscribers

People subscribed via source and target branches