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
=== modified file 'purchase_order_webkit/report/purchase_order.mako'
--- purchase_order_webkit/report/purchase_order.mako 2014-01-22 10:39:22 +0000
+++ purchase_order_webkit/report/purchase_order.mako 2014-04-07 16:14:32 +0000
@@ -179,27 +179,34 @@
179}179}
180td.main_col1 {180td.main_col1 {
181 text-align:left;181 text-align:left;
182 vertical-align:top;
182}183}
183.main_col2 {184.main_col2 {
184 width: 10%;185 width: 10%;
186 vertical-align:top;
185}187}
186.main_col3 {188.main_col3 {
187 width: 10%;189 width: 10%;
188 text-align:center;190 text-align:center;
191 vertical-align:top;
189}192}
190.main_col6 {193.main_col6 {
191 width: 10%;194 width: 10%;
195 vertical-align:top;
192}196}
193.main_col4 {197.main_col4 {
194 width: 10%;198 width: 10%;
195 text-align:right;199 text-align:right;
200 vertical-align:top;
196}201}
197.main_col5 {202.main_col5 {
198 width: 7%;203 width: 7%;
199 text-align:left;204 text-align:left;
205 vertical-align:top;
200}206}
201.main_col7 {207.main_col7 {
202 width: 13%;208 width: 13%;
209 vertical-align:top;
203}210}
204211
205212
@@ -297,12 +304,12 @@
297 <div class="nobreak">304 <div class="nobreak">
298 <table style="width:100%">305 <table style="width:100%">
299 <tr>306 <tr>
300 <td class="main_col1">${line.name}</td>307 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
301 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>308 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>
302 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>309 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
303 <td class="amount main_col4">${line.product_qty}</td>310 <td class="amount main_col4">${line.product_qty}</td>
304 <td class="main_col5">${line.product_uom.name}</td>311 <td class="main_col5">${line.product_uom.name}</td>
305 <td class="amount main col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>312 <td class="amount main_col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
306 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>313 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>
307 </tr>314 </tr>
308 </table>315 </table>
309316
=== modified file 'purchase_order_webkit/report/request_quotation.mako'
--- purchase_order_webkit/report/request_quotation.mako 2014-01-10 14:52:43 +0000
+++ purchase_order_webkit/report/request_quotation.mako 2014-04-07 16:14:32 +0000
@@ -179,27 +179,34 @@
179}179}
180td.main_col1 {180td.main_col1 {
181 text-align:left;181 text-align:left;
182 vertical-align:top;
182}183}
183.main_col2 {184.main_col2 {
184 width: 10%;185 width: 10%;
186 vertical-align:top;
185}187}
186.main_col3 {188.main_col3 {
187 width: 10%;189 width: 10%;
188 text-align:center;190 text-align:center;
191 vertical-align:top;
189}192}
190.main_col6 {193.main_col6 {
191 width: 10%;194 width: 10%;
195 vertical-align:top;
192}196}
193.main_col4 {197.main_col4 {
194 width: 10%;198 width: 10%;
195 text-align:right;199 text-align:right;
200 vertical-align:top;
196}201}
197.main_col5 {202.main_col5 {
198 width: 7%;203 width: 7%;
199 text-align:left;204 text-align:left;
205 vertical-align:top;
200}206}
201.main_col7 {207.main_col7 {
202 width: 13%;208 width: 13%;
209 vertical-align:top;
203}210}
204211
205212
@@ -263,9 +270,9 @@
263 <tr>270 <tr>
264 <th class="list_main_headers" style="width: 100%">271 <th class="list_main_headers" style="width: 100%">
265 <table style="width:100%">272 <table style="width:100%">
266 <th>${_("Description")}</th>273 <th class="main_col1">${_("Description")}</th>
267 <th>${_("Expected Date")}</th>274 <th class="main_col3">${_("Expected Date")}</th>
268 <th class="amount">${_("Qty")}</th>275 <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
269 </tr>276 </tr>
270 </table>277 </table>
271 </th>278 </th>
@@ -277,13 +284,13 @@
277 <div class="nobreak">284 <div class="nobreak">
278 <table style="width:100%">285 <table style="width:100%">
279 <tr>286 <tr>
280 %for line in purch.order_line :287 %for line in purch.order_line :
281 <tr class="line">288 <tr class="line">
282 <td>${line.name}</td>289 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
283 <td>${formatLang(line.date_planned, date=True)}</td>290 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
284 <td class="amount">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>291 <td class="amount main_col4">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
285 </tr>292 </tr>
286 %endfor293 %endfor
287 </table>294 </table>
288 </div>295 </div>
289 </td>296 </td>
290297
=== modified file 'purchase_order_webkit_with_notes/report/purchase_order.mako'
--- purchase_order_webkit_with_notes/report/purchase_order.mako 2014-01-22 10:39:22 +0000
+++ purchase_order_webkit_with_notes/report/purchase_order.mako 2014-04-07 16:14:32 +0000
@@ -179,27 +179,34 @@
179}179}
180td.main_col1 {180td.main_col1 {
181 text-align:left;181 text-align:left;
182 vertical-align:top;
182}183}
183.main_col2 {184.main_col2 {
184 width: 10%;185 width: 10%;
186 vertical-align:top;
185}187}
186.main_col3 {188.main_col3 {
187 width: 10%;189 width: 10%;
188 text-align:center;190 text-align:center;
191 vertical-align:top;
189}192}
190.main_col6 {193.main_col6 {
191 width: 10%;194 width: 10%;
195 vertical-align:top;
192}196}
193.main_col4 {197.main_col4 {
194 width: 10%;198 width: 10%;
195 text-align:right;199 text-align:right;
200 vertical-align:top;
196}201}
197.main_col5 {202.main_col5 {
198 width: 7%;203 width: 7%;
199 text-align:left;204 text-align:left;
205 vertical-align:top;
200}206}
201.main_col7 {207.main_col7 {
202 width: 13%;208 width: 13%;
209 vertical-align:top;
203}210}
204211
205212
@@ -300,12 +307,12 @@
300 <div class="nobreak">307 <div class="nobreak">
301 <table style="width:100%">308 <table style="width:100%">
302 <tr>309 <tr>
303 <td class="main_col1">${line.name}</td>310 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
304 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>311 <td style="text-align:center" class="main_col2">${ ', '.join([ tax.name or '' for tax in line.taxes_id ])}</td>
305 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>312 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
306 <td class="amount main_col4">${line.product_qty}</td>313 <td class="amount main_col4">${line.product_qty}</td>
307 <td class="main_col5">${line.product_uom.name}</td>314 <td class="main_col5">${line.product_uom.name}</td>
308 <td class="amount main col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>315 <td class="amount main_col6">${formatLang(line.price_unit, digits=get_digits(dp='Purchase Price'))}</td>
309 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>316 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'))} ${purch.pricelist_id.currency_id.symbol}</td>
310 </tr>317 </tr>
311 </table>318 </table>
312319
=== modified file 'purchase_order_webkit_with_notes/report/request_quotation.mako'
--- purchase_order_webkit_with_notes/report/request_quotation.mako 2014-01-17 15:26:14 +0000
+++ purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-07 16:14:32 +0000
@@ -179,27 +179,34 @@
179}179}
180td.main_col1 {180td.main_col1 {
181 text-align:left;181 text-align:left;
182 vertical-align:top;
182}183}
183.main_col2 {184.main_col2 {
184 width: 10%;185 width: 10%;
186 vertical-align:top;
185}187}
186.main_col3 {188.main_col3 {
187 width: 10%;189 width: 10%;
188 text-align:center;190 text-align:center;
191 vertical-align:top;
189}192}
190.main_col6 {193.main_col6 {
191 width: 10%;194 width: 10%;
195 vertical-align:top;
192}196}
193.main_col4 {197.main_col4 {
194 width: 10%;198 width: 10%;
195 text-align:right;199 text-align:right;
200 vertical-align:top;
196}201}
197.main_col5 {202.main_col5 {
198 width: 7%;203 width: 7%;
199 text-align:left;204 text-align:left;
205 vertical-align:top;
200}206}
201.main_col7 {207.main_col7 {
202 width: 13%;208 width: 13%;
209 vertical-align:top;
203}210}
204211
205212
@@ -266,9 +273,9 @@
266 <tr>273 <tr>
267 <th class="list_main_headers" style="width: 100%">274 <th class="list_main_headers" style="width: 100%">
268 <table style="width:100%">275 <table style="width:100%">
269 <th>${_("Description")}</th>276 <th class="main_col1">${_("Description")}</th>
270 <th>${_("Expected Date")}</th>277 <th class="main_col3">${_("Expected Date")}</th>
271 <th class="amount">${_("Qty")}</th>278 <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
272 </tr>279 </tr>
273 </table>280 </table>
274 </th>281 </th>
@@ -280,12 +287,12 @@
280 <div class="nobreak">287 <div class="nobreak">
281 <table style="width:100%">288 <table style="width:100%">
282 <tr>289 <tr>
283 %for line in purch.order_line :290 %for line in purch.order_line :
284 <tr class="line">291 <tr class="line">
285 <td>${line.name}</td>292 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
286 <td>${formatLang(line.date_planned, date=True)}</td>293 <td style="text-align:center" class="main_col3">${formatLang(line.date_planned, date=True)}</td>
287 <td class="amount">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>294 <td class="amount main_col4">${line.product_qty} ${line.product_uom and line.product_uom.name or ''}</td>
288 </tr>295 </tr>
289 %endfor296 %endfor
290 </table>297 </table>
291 </div>298 </div>

Subscribers

People subscribed via source and target branches