Merge lp:~agilebg/account-invoice-report/7.0-fix_invoice_webkit_description_bugs into lp:~account-core-editors/account-invoice-report/7.0

Proposed by Alex Comba - Agile BG
Status: Needs review
Proposed branch: lp:~agilebg/account-invoice-report/7.0-fix_invoice_webkit_description_bugs
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 328 lines (+100/-153)
1 file modified
invoice_webkit/report/account_invoice.mako (+100/-153)
To merge this branch: bzr merge lp:~agilebg/account-invoice-report/7.0-fix_invoice_webkit_description_bugs
Reviewer Review Type Date Requested Status
Vincent Renaville@camptocamp (community) Needs Information
Yannick Vaucher @ Camptocamp Disapprove
Lorenzo Battistini (community) Needs Fixing
Review via email: mp+205204@code.launchpad.net

Commit message

[FIX] invoice_webkit bugs: #1208389, #1231329 and #1277024

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

l 324: <p class="std_text">${inv.note2 | n}</> should be <p class="std_text">${inv.note2 | n} />

review: Needs Fixing
Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

Lorenzo, my new commit should have fixed, please have a look at it.

Thank you.

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

I disagree with renaming back list_main_table to list_invoice_table

This was intended to be able to use same css through invoice, sale_order and so on.

Plus it seems to me it reintroduce
https://bugs.launchpad.net/account-invoice-report/+bug/1231329

Does this fix still ensure that a formated_note line is on the same page as its invoice line?
I see you removed that nobreak.

review: Needs Information
Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

Yannick,

you are right, we had not taken into consideration that type of problem related to formatted_note.

However, we still have to fix these two bugs:

https://bugs.launchpad.net/account-invoice-report/+bug/1208389 [1]
https://bugs.launchpad.net/account-invoice-report/+bug/1277024 [2]

[1] is easy to fix while [2] seems to harder. I played a bit whith [2], I tried to use the table-layout CSS property. This apparently improves the situation but it doesn't fix it in total.

Any ideas?

Thank you in advance.

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

If you set `word-wrap: break-word` on td where you print line.name

Plus `table-layout: fixed` on the inner table and it should do the trick

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

Bug #1208389: [7.0] invoice_webkit - invoice line does not print line description

Is better fixed here:
https://code.launchpad.net/~camptocamp/account-invoice-report/account-invoice-webkit-line-description-vre/+merge/217929

I disapprove as it still replace css

review: Disapprove
Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

Thanks for you proposal.

Just a question why did you create a complex style at line 303, instead of use a specific class (like in the current version) ?

Vincent

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

Have you tried word-wrap: break-word and table-layout: fixed ?

I merged Vincent MP so it seems the last bug to resolve is
https://bugs.launchpad.net/account-invoice-report/+bug/1277024

Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

Yannick wrote:
> Have you tried word-wrap: break-word and table-layout: fixed ?

Hi Yannick,

yes I tried, but it doesn't seem to work.

> I merged Vincent MP

Thank you.

> so it seems the last bug to resolve is https://bugs.launchpad.net/account-invoice-report/+bug/1277024

Yes, it's right.

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Hello Yannick and Vincent,

I renamed list_invoice_table to list_main_table.

As you saw, in order to fix bug 1277024 we had to remove the nested tables but this reintroduced the bug 1231329.
In order to fix bug 1231329, I moved the formatted_note within the 'nobreak' div containing line.name

See the result of the new layout at https://app.box.com/s/0i8ra35jlnqken7dvp7n

Thanks

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

This project is now hosted on https://github.com/OCA/account-invoice-reporting. Please move your proposal there if you still want to merge it once fixed. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Sorry Lorenzo didn't had the time to look closely at this MP again. Can we continue this on github ?

Revision history for this message
Lorenzo Battistini (elbati) wrote :

"Sorry Lorenzo didn't had the time to look closely at this MP again. Can we continue this on github ?"

Gladly!

Here it is
https://github.com/OCA/account-invoice-reporting/pull/2

Unmerged revisions

58. By Lorenzo Battistini

[MERGE] from lp:account-invoice-report
including fix from
https://code.launchpad.net/~camptocamp/account-invoice-report/account-invoice-webkit-line-description-vre/+merge/217929

57. By Lorenzo Battistini

[FIX] formatted_note with nobreak

56. By Lorenzo Battistini

[IMP] renaming to list_main_table

55. By Alex Comba - Agile BG

[FIX] typo

54. By Alex Comba - Agile BG

[REM] empty space

53. By Alex Comba - Agile BG

[FIX] Reverted changes committed in rev 52

52. By Alex Comba - Agile BG

[FIX] end p tags

51. By Alex Comba - Agile BG

[FIX] bug lp:1231329 - 'lines are separated from their description on page break'

50. By Alex Comba - Agile BG

[FIX] Reverted some parts of this revision http://bazaar.launchpad.net/~account-core-editors/account-invoice-report/7.0/revision/40.2.1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'invoice_webkit/report/account_invoice.mako'
--- invoice_webkit/report/account_invoice.mako 2014-05-01 15:23:35 +0000
+++ invoice_webkit/report/account_invoice.mako 2014-06-18 13:27:10 +0000
@@ -9,92 +9,34 @@
9 text-align:center;9 text-align:center;
10 border-collapse: collapse;10 border-collapse: collapse;
11}11}
12table.list_main_table {12.list_main_table th {
13 margin-top: 20px;13 background-color: #EEEEEE;
14}
15.list_main_headers {
16 padding: 0;
17}
18.list_main_headers th {
19 border: thin solid #000000;14 border: thin solid #000000;
15 text-align:center;
16 font-size:12;
17 font-weight:bold;
20 padding-right:3px;18 padding-right:3px;
21 padding-left:3px;19 padding-left:3px;
22 background-color: #EEEEEE;
23 text-align:center;
24 font-size:12;
25 font-weight:bold;
26}20}
27.list_main_table td {21.list_main_table td {
22 border-top : thin solid #EEEEEE;
23 text-align:left;
24 font-size:12;
28 padding-right:3px;25 padding-right:3px;
29 padding-left:3px;26 padding-left:3px;
30 padding-top:3px;27 padding-top:3px;
31 padding-bottom:3px;28 padding-bottom:3px;
32}29}
33.list_main_lines,30.list_main_table thead {
34.list_main_footers {31 display:table-header-group;
35 padding: 0;32}
36}33
37.list_main_footers {34div.formatted_note {
38 padding-top: 15px;35 text-align:left;
39}
40.list_main_lines td,
41.list_main_footers td,
42.list_main_footers th {
43 border-style: none;
44 text-align:left;
45 font-size:12;
46 padding:0;
47}
48.list_main_footers th {
49 text-align:right;
50}
51
52td .total_empty_cell {
53 width: 77%;
54}
55td .total_sum_cell {
56 width: 13%;
57}
58
59.nobreak {
60 page-break-inside: avoid;
61}
62caption.formatted_note {
63 text-align:left;
64 border-right:thin solid #EEEEEE;
65 border-left:thin solid #EEEEEE;
66 border-top:thin solid #EEEEEE;
67 padding-left:10px;36 padding-left:10px;
68 font-size:11;37 font-size:11;
69 caption-side: bottom;
70}
71caption.formatted_note p {
72 margin: 0;
73}38}
7439
75.main_col1 {
76 width: 40%;
77}
78td.main_col1 {
79 text-align:left;
80}
81.main_col2,
82.main_col3,
83.main_col4,
84.main_col6 {
85 width: 10%;
86}
87.main_col5 {
88 width: 7%;
89}
90td.main_col5 {
91 text-align: center;
92 font-style:italic;
93 font-size: 10;
94}
95.main_col7 {
96 width: 13%;
97}
9840
99.list_bank_table {41.list_bank_table {
100 text-align:center;42 text-align:center;
@@ -169,6 +111,11 @@
169 display:table-header-group;111 display:table-header-group;
170}112}
171113
114
115.no_bloc {
116 border-top: thin solid #ffffff ;
117}
118
172.right_table {119.right_table {
173 right: 4cm;120 right: 4cm;
174 width:"100%";121 width:"100%";
@@ -178,6 +125,10 @@
178 font-size:12;125 font-size:12;
179}126}
180127
128tfoot.totals tr:first-child td{
129 padding-top: 15px;
130}
131
181th.date {132th.date {
182 width: 90px;133 width: 90px;
183}134}
@@ -186,6 +137,19 @@
186 text-align: right;137 text-align: right;
187 white-space: nowrap;138 white-space: nowrap;
188}139}
140.header_table {
141 text-align: center;
142 border: 1px solid lightGrey;
143 border-collapse: collapse;
144}
145.header_table th {
146 font-size: 12px;
147 border: 1px solid lightGrey;
148}
149.header_table td {
150 font-size: 12px;
151 border: 1px solid lightGrey;
152}
189153
190td.date {154td.date {
191 white-space: nowrap;155 white-space: nowrap;
@@ -202,6 +166,14 @@
202 float: right;166 float: right;
203}167}
204168
169.nobreak {
170 page-break-inside: avoid;
171 }
172
173.align_top {
174 vertical-align:text-top;
175 }
176
205 </style>177 </style>
206</head>178</head>
207<body>179<body>
@@ -300,87 +272,62 @@
300 %endif272 %endif
301 </div>273 </div>
302274
303 <table class="list_main_table" width="100%">275 <table class="list_main_table" width="100%" style="margin-top: 20px;">
304 <thead>276 <thead>
305 <tr>277 <tr>
306 <th class="list_main_headers" style="width: 100%">278 <th>${_("Description")}</th>
307 <table style="width:100%">279 <th>${_("Qty")}</th>
308 <tr>280 <th>${_("UoM")}</th>
309 <th class="main_col1">${_("Description")}</th>281 <th>${_("Unit Price")}</th>
310 <th class="amount main_col2">${_("Qty")}</th>282 <th>${_("Taxes")}</th>
311 <th class="amount main_col3">${_("UoM")}</th>283 <th>${_("Disc.(%)")}</th>
312 <th class="amount main_col4">${_("Unit Price")}</th>284 <th>${_("Net Sub Total")}</th>
313 <th class="main_col5">${_("Taxes")}</th>285 </tr>
314 <th class="amount main_col6">${_("Disc.(%)")}</th>286 </thead>
315 <th class="amount main_col7">${_("Net Sub Total")}</th>287 <tbody>
316 </tr>288 %for line in inv.invoice_line :
317 </table>289 <tr>
318 </th>290 <td class="align_top"><div class="nobreak">${line.name.replace('\n','<br/>') or '' | n}
319 </tr>291 %if line.formatted_note:
320 </thead>292 <br />
321 <tbody>293 <div class="formatted_note">${line.formatted_note| n}</div>
322 %for line in inv.invoice_line:294 %endif
323 <tr>295 </div></td>
324 <td class="list_main_lines" style="width: 100%">296 <td class="amount align_top">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>
325 <div class="nobreak">297 <td class="amount align_top">${line.uos_id and line.uos_id.name or ''}</td>
326 <table style="width:100%">298 <td class="amount align_top">${formatLang(line.price_unit)}</td>
327 <tr>299 <td class="align_top" style="font-style:italic; font-size: 10;text-align:center;" >${ ', '.join([ tax.description or tax.name for tax in line.invoice_line_tax_id ])}</td>
328 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>300 <td class="amount align_top" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
329 <td class="amount main_col2">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>301 <td class="amount align_top" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
330 <td class="amount main_col3">${line.uos_id and line.uos_id.name or ''}</td>302 </tr>
331 <td class="amount main_col4">${formatLang(line.price_unit)}</td>
332 <td class="main_col5">${ ', '.join([tax.description or tax.name for tax in line.invoice_line_tax_id])}</td>
333 <td class="amount main_col6">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
334 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
335 </tr>
336 %if line.formatted_note:
337 <caption class="formatted_note">
338 ${line.formatted_note| n}
339 </caption>
340 %endif
341 </table>
342 </div>
343 </td>
344 </tr>
345 %endfor303 %endfor
346 </tbody>304 </tbody>
347 <tfoot class="totals">305 <tfoot class="totals">
348 <tr>306 <tr>
349 <td class="list_main_footers" style="width: 100%">307 <td colspan="6" style="text-align:right;border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
350 <div class="nobreak">308 <b>${_("Net :")}</b>
351 <table style="width:100%">309 </td>
352 <tr>310 <td class="amount" style="border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
353 <td class="total_empty_cell"/>
354 <th>
355 ${_("Net :")}
356 </th>
357 <td class="amount total_sum_cell">
358 ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}311 ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
359 </td>312 </td>
360 </tr>313 </tr>
361 <tr>314 <tr class="no_bloc">
362 <td class="total_empty_cell"/>315 <td colspan="6" style="text-align:right; border-top: thin solid #ffffff ; border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
363 <th>316 <b>${_("Taxes:")}</b>
364 ${_("Taxes:")}317 </td>
365 </th>318 <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;">
366 <td class="amount total_sum_cell">319 ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
367 ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}320 </td>
368 </td>321 </tr>
369 </tr>322 <tr>
370 <tr>323 <td colspan="6" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;border-bottom: thin solid #ffffff ;text-align:right;">
371 <td class="total_empty_cell"/>324 <b>${_("Total:")}</b>
372 <th>325 </td>
373 ${_("Total:")}326 <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;border-bottom: thin solid #ffffff ;">
374 </th>327 <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>
375 <td class="amount total_sum_cell">328 </td>
376 <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>329 </tr>
377 </td>330 </tfoot>
378 </tr>
379 </table>
380 </div>
381 </td>
382 </tr>
383 </tfoot>
384 </table>331 </table>
385 <br/>332 <br/>
386 <table class="list_total_table" width="60%" >333 <table class="list_total_table" width="60%" >
@@ -434,7 +381,7 @@
434 </div>381 </div>
435 </div>382 </div>
436 <br/>383 <br/>
437 %if inv.comment :384 %if inv.comment:
438 <p class="std_text">${inv.comment | carriage_returns}</p>385 <p class="std_text">${inv.comment | carriage_returns}</p>
439 %endif386 %endif
440 %if inv.note2 :387 %if inv.note2 :
@@ -446,7 +393,7 @@
446 ${inv.fiscal_position.note | n}393 ${inv.fiscal_position.note | n}
447 </p>394 </p>
448 %endif395 %endif
449 <p style="page-break-after:always"/>396 <p style="page-break-after:always"></p>
450 %endfor397 %endfor
451</body>398</body>
452</html>399</html>

Subscribers

People subscribed via source and target branches