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
1=== modified file 'invoice_webkit/report/account_invoice.mako'
2--- invoice_webkit/report/account_invoice.mako 2014-05-01 15:23:35 +0000
3+++ invoice_webkit/report/account_invoice.mako 2014-06-18 13:27:10 +0000
4@@ -9,92 +9,34 @@
5 text-align:center;
6 border-collapse: collapse;
7 }
8-table.list_main_table {
9- margin-top: 20px;
10-}
11-.list_main_headers {
12- padding: 0;
13-}
14-.list_main_headers th {
15+.list_main_table th {
16+ background-color: #EEEEEE;
17 border: thin solid #000000;
18+ text-align:center;
19+ font-size:12;
20+ font-weight:bold;
21 padding-right:3px;
22 padding-left:3px;
23- background-color: #EEEEEE;
24- text-align:center;
25- font-size:12;
26- font-weight:bold;
27 }
28 .list_main_table td {
29+ border-top : thin solid #EEEEEE;
30+ text-align:left;
31+ font-size:12;
32 padding-right:3px;
33 padding-left:3px;
34 padding-top:3px;
35 padding-bottom:3px;
36 }
37-.list_main_lines,
38-.list_main_footers {
39- padding: 0;
40-}
41-.list_main_footers {
42- padding-top: 15px;
43-}
44-.list_main_lines td,
45-.list_main_footers td,
46-.list_main_footers th {
47- border-style: none;
48- text-align:left;
49- font-size:12;
50- padding:0;
51-}
52-.list_main_footers th {
53- text-align:right;
54-}
55-
56-td .total_empty_cell {
57- width: 77%;
58-}
59-td .total_sum_cell {
60- width: 13%;
61-}
62-
63-.nobreak {
64- page-break-inside: avoid;
65-}
66-caption.formatted_note {
67- text-align:left;
68- border-right:thin solid #EEEEEE;
69- border-left:thin solid #EEEEEE;
70- border-top:thin solid #EEEEEE;
71+.list_main_table thead {
72+ display:table-header-group;
73+}
74+
75+div.formatted_note {
76+ text-align:left;
77 padding-left:10px;
78 font-size:11;
79- caption-side: bottom;
80-}
81-caption.formatted_note p {
82- margin: 0;
83 }
84
85-.main_col1 {
86- width: 40%;
87-}
88-td.main_col1 {
89- text-align:left;
90-}
91-.main_col2,
92-.main_col3,
93-.main_col4,
94-.main_col6 {
95- width: 10%;
96-}
97-.main_col5 {
98- width: 7%;
99-}
100-td.main_col5 {
101- text-align: center;
102- font-style:italic;
103- font-size: 10;
104-}
105-.main_col7 {
106- width: 13%;
107-}
108
109 .list_bank_table {
110 text-align:center;
111@@ -169,6 +111,11 @@
112 display:table-header-group;
113 }
114
115+
116+.no_bloc {
117+ border-top: thin solid #ffffff ;
118+}
119+
120 .right_table {
121 right: 4cm;
122 width:"100%";
123@@ -178,6 +125,10 @@
124 font-size:12;
125 }
126
127+tfoot.totals tr:first-child td{
128+ padding-top: 15px;
129+}
130+
131 th.date {
132 width: 90px;
133 }
134@@ -186,6 +137,19 @@
135 text-align: right;
136 white-space: nowrap;
137 }
138+.header_table {
139+ text-align: center;
140+ border: 1px solid lightGrey;
141+ border-collapse: collapse;
142+}
143+.header_table th {
144+ font-size: 12px;
145+ border: 1px solid lightGrey;
146+}
147+.header_table td {
148+ font-size: 12px;
149+ border: 1px solid lightGrey;
150+}
151
152 td.date {
153 white-space: nowrap;
154@@ -202,6 +166,14 @@
155 float: right;
156 }
157
158+.nobreak {
159+ page-break-inside: avoid;
160+ }
161+
162+.align_top {
163+ vertical-align:text-top;
164+ }
165+
166 </style>
167 </head>
168 <body>
169@@ -300,87 +272,62 @@
170 %endif
171 </div>
172
173- <table class="list_main_table" width="100%">
174- <thead>
175- <tr>
176- <th class="list_main_headers" style="width: 100%">
177- <table style="width:100%">
178- <tr>
179- <th class="main_col1">${_("Description")}</th>
180- <th class="amount main_col2">${_("Qty")}</th>
181- <th class="amount main_col3">${_("UoM")}</th>
182- <th class="amount main_col4">${_("Unit Price")}</th>
183- <th class="main_col5">${_("Taxes")}</th>
184- <th class="amount main_col6">${_("Disc.(%)")}</th>
185- <th class="amount main_col7">${_("Net Sub Total")}</th>
186- </tr>
187- </table>
188- </th>
189- </tr>
190- </thead>
191- <tbody>
192- %for line in inv.invoice_line:
193- <tr>
194- <td class="list_main_lines" style="width: 100%">
195- <div class="nobreak">
196- <table style="width:100%">
197- <tr>
198- <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
199- <td class="amount main_col2">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>
200- <td class="amount main_col3">${line.uos_id and line.uos_id.name or ''}</td>
201- <td class="amount main_col4">${formatLang(line.price_unit)}</td>
202- <td class="main_col5">${ ', '.join([tax.description or tax.name for tax in line.invoice_line_tax_id])}</td>
203- <td class="amount main_col6">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
204- <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
205- </tr>
206- %if line.formatted_note:
207- <caption class="formatted_note">
208- ${line.formatted_note| n}
209- </caption>
210- %endif
211- </table>
212- </div>
213- </td>
214- </tr>
215+ <table class="list_main_table" width="100%" style="margin-top: 20px;">
216+ <thead>
217+ <tr>
218+ <th>${_("Description")}</th>
219+ <th>${_("Qty")}</th>
220+ <th>${_("UoM")}</th>
221+ <th>${_("Unit Price")}</th>
222+ <th>${_("Taxes")}</th>
223+ <th>${_("Disc.(%)")}</th>
224+ <th>${_("Net Sub Total")}</th>
225+ </tr>
226+ </thead>
227+ <tbody>
228+ %for line in inv.invoice_line :
229+ <tr>
230+ <td class="align_top"><div class="nobreak">${line.name.replace('\n','<br/>') or '' | n}
231+ %if line.formatted_note:
232+ <br />
233+ <div class="formatted_note">${line.formatted_note| n}</div>
234+ %endif
235+ </div></td>
236+ <td class="amount align_top">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>
237+ <td class="amount align_top">${line.uos_id and line.uos_id.name or ''}</td>
238+ <td class="amount align_top">${formatLang(line.price_unit)}</td>
239+ <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>
240+ <td class="amount align_top" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
241+ <td class="amount align_top" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
242+ </tr>
243 %endfor
244- </tbody>
245- <tfoot class="totals">
246- <tr>
247- <td class="list_main_footers" style="width: 100%">
248- <div class="nobreak">
249- <table style="width:100%">
250- <tr>
251- <td class="total_empty_cell"/>
252- <th>
253- ${_("Net :")}
254- </th>
255- <td class="amount total_sum_cell">
256+ </tbody>
257+ <tfoot class="totals">
258+ <tr>
259+ <td colspan="6" style="text-align:right;border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
260+ <b>${_("Net :")}</b>
261+ </td>
262+ <td class="amount" style="border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
263 ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
264- </td>
265- </tr>
266- <tr>
267- <td class="total_empty_cell"/>
268- <th>
269- ${_("Taxes:")}
270- </th>
271- <td class="amount total_sum_cell">
272- ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
273- </td>
274- </tr>
275- <tr>
276- <td class="total_empty_cell"/>
277- <th>
278- ${_("Total:")}
279- </th>
280- <td class="amount total_sum_cell">
281- <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>
282- </td>
283- </tr>
284- </table>
285- </div>
286- </td>
287- </tr>
288- </tfoot>
289+ </td>
290+ </tr>
291+ <tr class="no_bloc">
292+ <td colspan="6" style="text-align:right; border-top: thin solid #ffffff ; border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">
293+ <b>${_("Taxes:")}</b>
294+ </td>
295+ <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;">
296+ ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
297+ </td>
298+ </tr>
299+ <tr>
300+ <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;">
301+ <b>${_("Total:")}</b>
302+ </td>
303+ <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;border-bottom: thin solid #ffffff ;">
304+ <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>
305+ </td>
306+ </tr>
307+ </tfoot>
308 </table>
309 <br/>
310 <table class="list_total_table" width="60%" >
311@@ -434,7 +381,7 @@
312 </div>
313 </div>
314 <br/>
315- %if inv.comment :
316+ %if inv.comment:
317 <p class="std_text">${inv.comment | carriage_returns}</p>
318 %endif
319 %if inv.note2 :
320@@ -446,7 +393,7 @@
321 ${inv.fiscal_position.note | n}
322 </p>
323 %endif
324- <p style="page-break-after:always"/>
325+ <p style="page-break-after:always"></p>
326 %endfor
327 </body>
328 </html>

Subscribers

People subscribed via source and target branches