Merge lp:~camptocamp/sale-reports/sale-reports-add-so-webkit into lp:~sale-core-editors/sale-reports/7.0
- sale-reports-add-so-webkit
- Merge into 7.0
Status: | Merged |
---|---|
Merged at revision: | 10 |
Proposed branch: | lp:~camptocamp/sale-reports/sale-reports-add-so-webkit |
Merge into: | lp:~sale-core-editors/sale-reports/7.0 |
Diff against target: |
818 lines (+765/-0) 10 files modified
sale_order_webkit/__init__.py (+22/-0) sale_order_webkit/__openerp__.py (+46/-0) sale_order_webkit/i18n/fr.po (+98/-0) sale_order_webkit/i18n/sale_order_webkit.pot (+98/-0) sale_order_webkit/report/__init__.py (+22/-0) sale_order_webkit/report/sale_order.mako (+269/-0) sale_order_webkit/report/sale_order.py (+41/-0) sale_order_webkit/sale.py (+72/-0) sale_order_webkit/sale_report.xml (+13/-0) sale_order_webkit/view/sale_view.xml (+84/-0) |
To merge this branch: | bzr merge lp:~camptocamp/sale-reports/sale-reports-add-so-webkit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Niels Huylebroeck (community) | Approve | ||
Guewen Baconnier @ Camptocamp | code review, no test | Approve | |
Alexandre Fayolle - camptocamp | code review, no test | Pending | |
Review via email: mp+144875@code.launchpad.net |
This proposal supersedes a proposal from 2013-01-24.
Commit message
Description of the change
Port of sale order webkit report + add HTML not and sale conditions
+ fix file licence
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : Posted in a previous version of this proposal | # |
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Posted in a previous version of this proposal | # |
628 + if company_vat:
629 + return company_vat
630 + else:
631 + return False
I think this can be rewritten as "return company_vat"
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Just fixed the if statement
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
LGTM
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Hello,
If nobody has an objection can we merge this module. It starts to be blocking.
Regards
Nicolas
Niels Huylebroeck (red15) wrote : | # |
Considering the changes in the v7 for the partner address it would be advised to also use the date formatting as used in the default sale order.
In the sale/report/
Considering the blocking nature of this merge I will give it approve and try to merge it, I just thought it could help you guys in the future for more compatibility with the rest of openerp.
Niels Huylebroeck (red15) wrote : | # |
Just noticed that you have not yet committed (at least not here) the module base_headers_webkit ?
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Hello,
the header are in this branch:
https:/
Regards
Nicolas
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) : Posted in a previous version of this proposal | # |
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : Posted in a previous version of this proposal | # |
Hello,
This MP has been approved and merged by Alexandre Fayolle indirectly with:
https:/
Regards
Preview Diff
1 | === added directory 'sale_order_webkit' |
2 | === added file 'sale_order_webkit/__init__.py' |
3 | --- sale_order_webkit/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ sale_order_webkit/__init__.py 2013-01-25 09:44:22 +0000 |
5 | @@ -0,0 +1,22 @@ |
6 | +# -*- coding: utf-8 -*- |
7 | +############################################################################## |
8 | +# |
9 | +# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) |
10 | +# @author Nicolas Bessi, Vincent Renaville, Guewen Baconnier |
11 | +# |
12 | +# This program is free software: you can redistribute it and/or modify |
13 | +# it under the terms of the GNU Affero General Public License as |
14 | +# published by the Free Software Foundation, either version 3 of the |
15 | +# License, or (at your option) any later version. |
16 | +# |
17 | +# This program is distributed in the hope that it will be useful, |
18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | +# GNU Affero General Public License for more details. |
21 | +# |
22 | +# You should have received a copy of the GNU Affero General Public License |
23 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | +# |
25 | +############################################################################## |
26 | +from . import sale |
27 | +from . import report |
28 | |
29 | === added file 'sale_order_webkit/__openerp__.py' |
30 | --- sale_order_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 |
31 | +++ sale_order_webkit/__openerp__.py 2013-01-25 09:44:22 +0000 |
32 | @@ -0,0 +1,46 @@ |
33 | +# -*- coding: utf-8 -*- |
34 | +############################################################################## |
35 | +# |
36 | +# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) |
37 | +# @author Nicolas Bessi, Vincent Renaville, Guewen Baconnier |
38 | +# |
39 | +# This program is free software: you can redistribute it and/or modify |
40 | +# it under the terms of the GNU Affero General Public License as |
41 | +# published by the Free Software Foundation, either version 3 of the |
42 | +# License, or (at your option) any later version. |
43 | +# |
44 | +# This program is distributed in the hope that it will be useful, |
45 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
46 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
47 | +# GNU Affero General Public License for more details. |
48 | +# |
49 | +# You should have received a copy of the GNU Affero General Public License |
50 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
51 | +# |
52 | +############################################################################## |
53 | + |
54 | +{'name': 'Sales Order Report using Webkit Library', |
55 | + 'version': '1.0.1', |
56 | + 'category': 'Reports/Webkit', |
57 | + 'description': """ |
58 | +Sale order webkit |
59 | +################# |
60 | + |
61 | +* Replaces the legacy RML Quotation/Sales Order report by a brand new webkit report. |
62 | +* Add header and footer notes |
63 | +* Add HTML note on Sale Order lines |
64 | + |
65 | +Depends on base_header_webkit community addon available here: |
66 | +`https://launchpad.net/webkit-utils <https://launchpad.net/webkit-utils>`_ |
67 | + """, |
68 | + 'author': 'Camptocamp', |
69 | + 'website': 'http://www.camptocamp.com', |
70 | + 'depends': ['base', 'report_webkit', 'base_headers_webkit', 'sale'], |
71 | + 'init_xml': [], |
72 | + 'update_xml': ['sale_report.xml', |
73 | + 'view/sale_view.xml'], |
74 | + 'demo_xml': [], |
75 | + 'test': [], |
76 | + 'installable': True, |
77 | + 'active': False, |
78 | + } |
79 | |
80 | === added directory 'sale_order_webkit/i18n' |
81 | === added file 'sale_order_webkit/i18n/fr.po' |
82 | --- sale_order_webkit/i18n/fr.po 1970-01-01 00:00:00 +0000 |
83 | +++ sale_order_webkit/i18n/fr.po 2013-01-25 09:44:22 +0000 |
84 | @@ -0,0 +1,98 @@ |
85 | +# Translation of OpenERP Server. |
86 | +# This file contains the translation of the following modules: |
87 | +# * sale_order_webkit |
88 | +# |
89 | +msgid "" |
90 | +msgstr "" |
91 | +"Project-Id-Version: OpenERP Server 6.0.3\n" |
92 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
93 | +"POT-Creation-Date: 2011-12-12 11:13+0000\n" |
94 | +"PO-Revision-Date: 2011-12-12 11:13+0000\n" |
95 | +"Last-Translator: <>\n" |
96 | +"Language-Team: \n" |
97 | +"MIME-Version: 1.0\n" |
98 | +"Content-Type: text/plain; charset=UTF-8\n" |
99 | +"Content-Transfer-Encoding: \n" |
100 | +"Plural-Forms: \n" |
101 | + |
102 | +#. module: sale_order_webkit |
103 | +#: report:addons/sale_order_webkit/report/sale_order.mako:78 |
104 | +msgid "Your Reference" |
105 | +msgstr "Votre Référence" |
106 | + |
107 | +#. module: sale_order_webkit |
108 | +#: report:addons/sale_order_webkit/report/sale_order.mako:35 |
109 | +msgid "Fax" |
110 | +msgstr "Fax" |
111 | + |
112 | +#. module: sale_order_webkit |
113 | +#: report:addons/sale_order_webkit/report/sale_order.mako:32 |
114 | +msgid "Tel" |
115 | +msgstr "Tél" |
116 | + |
117 | +#. module: sale_order_webkit |
118 | +#: report:addons/sale_order_webkit/report/sale_order.mako:94 |
119 | +msgid "Description" |
120 | +msgstr "Description" |
121 | + |
122 | +#. module: sale_order_webkit |
123 | +#: report:addons/sale_order_webkit/report/sale_order.mako:79 |
124 | +msgid "Quotation Date" |
125 | +msgstr "Date du devis" |
126 | + |
127 | +#. module: sale_order_webkit |
128 | +#: report:addons/sale_order_webkit/report/sale_order.mako:99 |
129 | +msgid "Price" |
130 | +msgstr "Prix" |
131 | + |
132 | +#. module: sale_order_webkit |
133 | +#: report:addons/sale_order_webkit/report/sale_order.mako:79 |
134 | +msgid "Date Ordered" |
135 | +msgstr "Date de commande" |
136 | + |
137 | +#. module: sale_order_webkit |
138 | +#: report:addons/sale_order_webkit/report/sale_order.mako:81 |
139 | +msgid "Payment Term" |
140 | +msgstr "Condition de règlement" |
141 | + |
142 | +#. module: sale_order_webkit |
143 | +#: report:addons/sale_order_webkit/report/sale_order.mako:38 |
144 | +msgid "E-mail" |
145 | +msgstr "E-mail" |
146 | + |
147 | +#. module: sale_order_webkit |
148 | +#: report:addons/sale_order_webkit/report/sale_order.mako:74 |
149 | +msgid "Quotation N°" |
150 | +msgstr "Devis N°" |
151 | + |
152 | +#. module: sale_order_webkit |
153 | +#: report:addons/sale_order_webkit/report/sale_order.mako:97 |
154 | +msgid "Unit Price" |
155 | +msgstr "Prix unitaire" |
156 | + |
157 | +#. module: sale_order_webkit |
158 | +#: report:addons/sale_order_webkit/report/sale_order.mako:74 |
159 | +msgid "Order N°" |
160 | +msgstr "N° de commande" |
161 | + |
162 | +#. module: sale_order_webkit |
163 | +#: report:addons/sale_order_webkit/report/sale_order.mako:98 |
164 | +msgid "Disc.(%)" |
165 | +msgstr "Rem.(%)" |
166 | + |
167 | +#. module: sale_order_webkit |
168 | +#: report:addons/sale_order_webkit/report/sale_order.mako:80 |
169 | +msgid "Salesman" |
170 | +msgstr "Vendeur" |
171 | + |
172 | +#. module: sale_order_webkit |
173 | +#: report:addons/sale_order_webkit/report/sale_order.mako:41 |
174 | +#: report:addons/sale_order_webkit/report/sale_order.mako:95 |
175 | +msgid "VAT" |
176 | +msgstr "TVA" |
177 | + |
178 | +#. module: sale_order_webkit |
179 | +#: report:addons/sale_order_webkit/report/sale_order.mako:96 |
180 | +msgid "Quantity" |
181 | +msgstr "Quantité" |
182 | + |
183 | |
184 | === added file 'sale_order_webkit/i18n/sale_order_webkit.pot' |
185 | --- sale_order_webkit/i18n/sale_order_webkit.pot 1970-01-01 00:00:00 +0000 |
186 | +++ sale_order_webkit/i18n/sale_order_webkit.pot 2013-01-25 09:44:22 +0000 |
187 | @@ -0,0 +1,98 @@ |
188 | +# Translation of OpenERP Server. |
189 | +# This file contains the translation of the following modules: |
190 | +# * sale_order_webkit |
191 | +# |
192 | +msgid "" |
193 | +msgstr "" |
194 | +"Project-Id-Version: OpenERP Server 6.0.3\n" |
195 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
196 | +"POT-Creation-Date: 2011-12-12 11:13+0000\n" |
197 | +"PO-Revision-Date: 2011-12-12 11:13+0000\n" |
198 | +"Last-Translator: <>\n" |
199 | +"Language-Team: \n" |
200 | +"MIME-Version: 1.0\n" |
201 | +"Content-Type: text/plain; charset=UTF-8\n" |
202 | +"Content-Transfer-Encoding: \n" |
203 | +"Plural-Forms: \n" |
204 | + |
205 | +#. module: sale_order_webkit |
206 | +#: report:addons/sale_order_webkit/report/sale_order.mako:78 |
207 | +msgid "Your Reference" |
208 | +msgstr "" |
209 | + |
210 | +#. module: sale_order_webkit |
211 | +#: report:addons/sale_order_webkit/report/sale_order.mako:35 |
212 | +msgid "Fax" |
213 | +msgstr "" |
214 | + |
215 | +#. module: sale_order_webkit |
216 | +#: report:addons/sale_order_webkit/report/sale_order.mako:32 |
217 | +msgid "Tel" |
218 | +msgstr "" |
219 | + |
220 | +#. module: sale_order_webkit |
221 | +#: report:addons/sale_order_webkit/report/sale_order.mako:94 |
222 | +msgid "Description" |
223 | +msgstr "" |
224 | + |
225 | +#. module: sale_order_webkit |
226 | +#: report:addons/sale_order_webkit/report/sale_order.mako:79 |
227 | +msgid "Quotation Date" |
228 | +msgstr "" |
229 | + |
230 | +#. module: sale_order_webkit |
231 | +#: report:addons/sale_order_webkit/report/sale_order.mako:99 |
232 | +msgid "Price" |
233 | +msgstr "" |
234 | + |
235 | +#. module: sale_order_webkit |
236 | +#: report:addons/sale_order_webkit/report/sale_order.mako:79 |
237 | +msgid "Date Ordered" |
238 | +msgstr "" |
239 | + |
240 | +#. module: sale_order_webkit |
241 | +#: report:addons/sale_order_webkit/report/sale_order.mako:81 |
242 | +msgid "Payment Term" |
243 | +msgstr "" |
244 | + |
245 | +#. module: sale_order_webkit |
246 | +#: report:addons/sale_order_webkit/report/sale_order.mako:38 |
247 | +msgid "E-mail" |
248 | +msgstr "" |
249 | + |
250 | +#. module: sale_order_webkit |
251 | +#: report:addons/sale_order_webkit/report/sale_order.mako:74 |
252 | +msgid "Quotation N°" |
253 | +msgstr "" |
254 | + |
255 | +#. module: sale_order_webkit |
256 | +#: report:addons/sale_order_webkit/report/sale_order.mako:97 |
257 | +msgid "Unit Price" |
258 | +msgstr "" |
259 | + |
260 | +#. module: sale_order_webkit |
261 | +#: report:addons/sale_order_webkit/report/sale_order.mako:74 |
262 | +msgid "Order N°" |
263 | +msgstr "" |
264 | + |
265 | +#. module: sale_order_webkit |
266 | +#: report:addons/sale_order_webkit/report/sale_order.mako:98 |
267 | +msgid "Disc.(%)" |
268 | +msgstr "" |
269 | + |
270 | +#. module: sale_order_webkit |
271 | +#: report:addons/sale_order_webkit/report/sale_order.mako:80 |
272 | +msgid "Salesman" |
273 | +msgstr "" |
274 | + |
275 | +#. module: sale_order_webkit |
276 | +#: report:addons/sale_order_webkit/report/sale_order.mako:41 |
277 | +#: report:addons/sale_order_webkit/report/sale_order.mako:95 |
278 | +msgid "VAT" |
279 | +msgstr "" |
280 | + |
281 | +#. module: sale_order_webkit |
282 | +#: report:addons/sale_order_webkit/report/sale_order.mako:96 |
283 | +msgid "Quantity" |
284 | +msgstr "" |
285 | + |
286 | |
287 | === added directory 'sale_order_webkit/report' |
288 | === added file 'sale_order_webkit/report/__init__.py' |
289 | --- sale_order_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 |
290 | +++ sale_order_webkit/report/__init__.py 2013-01-25 09:44:22 +0000 |
291 | @@ -0,0 +1,22 @@ |
292 | +# -*- coding: utf-8 -*- |
293 | +############################################################################## |
294 | +# |
295 | +# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) |
296 | +# @author Nicolas Bessi, Vincent Renaville, Guewen Baconnier |
297 | +# |
298 | +# This program is free software: you can redistribute it and/or modify |
299 | +# it under the terms of the GNU Affero General Public License as |
300 | +# published by the Free Software Foundation, either version 3 of the |
301 | +# License, or (at your option) any later version. |
302 | +# |
303 | +# This program is distributed in the hope that it will be useful, |
304 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
305 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
306 | +# GNU Affero General Public License for more details. |
307 | +# |
308 | +# You should have received a copy of the GNU Affero General Public License |
309 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
310 | +# |
311 | +############################################################################## |
312 | + |
313 | +from . import sale_order |
314 | |
315 | === added file 'sale_order_webkit/report/sale_order.mako' |
316 | --- sale_order_webkit/report/sale_order.mako 1970-01-01 00:00:00 +0000 |
317 | +++ sale_order_webkit/report/sale_order.mako 2013-01-25 09:44:22 +0000 |
318 | @@ -0,0 +1,269 @@ |
319 | +<html> |
320 | +<head> |
321 | + <style type="text/css"> |
322 | + ${css} |
323 | + |
324 | +.list_sale_table { |
325 | + border:thin solid #E3E4EA; |
326 | + text-align:center; |
327 | + border-collapse: collapse; |
328 | +} |
329 | + |
330 | +.list_sale_table td { |
331 | + border-top:thin solid #EEEEEE; |
332 | + text-align:right; |
333 | + font-size:12; |
334 | + padding-right:3px; |
335 | + padding-left:3px; |
336 | + padding-top:3px; |
337 | + padding-bottom:3px; |
338 | +} |
339 | + |
340 | +.list_bank_table { |
341 | + text-align:center; |
342 | + border-collapse: collapse; |
343 | +} |
344 | + |
345 | +.list_bank_table td { |
346 | + text-align:left; |
347 | + font-size:12; |
348 | + padding-right:3px; |
349 | + padding-left:3px; |
350 | + padding-top:3px; |
351 | + padding-bottom:3px; |
352 | +} |
353 | + |
354 | +.list_bank_table th { |
355 | + background-color: #EEEEEE; |
356 | + text-align:left; |
357 | + font-size:12; |
358 | + font-weight:bold; |
359 | + padding-right:3px |
360 | + padding-left:3px |
361 | +} |
362 | + |
363 | +.list_sale_table th { |
364 | + background-color: #EEEEEE; |
365 | + border: thin solid #000000; |
366 | + text-align:center; |
367 | + font-size:12; |
368 | + font-weight:bold; |
369 | + padding-right:3px; |
370 | + padding-left:3px; |
371 | +} |
372 | + |
373 | +.list_table thead { |
374 | + display:table-header-group; |
375 | +} |
376 | + |
377 | + |
378 | +.list_tax_table { |
379 | +} |
380 | +.list_tax_table td { |
381 | + text-align:left; |
382 | + font-size:12; |
383 | +} |
384 | + |
385 | + |
386 | +.list_table thead { |
387 | + display:table-header-group; |
388 | +} |
389 | + |
390 | + |
391 | +.list_total_table { |
392 | + border-collapse: collapse; |
393 | +} |
394 | + |
395 | +.list_total_table td { |
396 | + text-align:right; |
397 | + font-size:12; |
398 | +} |
399 | + |
400 | +.no_bloc { |
401 | + border-top: thin solid #ffffff ; |
402 | +} |
403 | + |
404 | + |
405 | +.list_total_table th { |
406 | + background-color: #F7F7F7; |
407 | + border-collapse: collapse; |
408 | +} |
409 | + |
410 | +tfoot.totals tr:first-child td{ |
411 | + padding-top: 15px; |
412 | +} |
413 | + |
414 | +.right_table { |
415 | + right: 4cm; |
416 | + width:"100%"; |
417 | +} |
418 | + |
419 | +.std_text { |
420 | + font-size:12; |
421 | +} |
422 | + |
423 | +.note { |
424 | + text-align:left; |
425 | + font-size:10; |
426 | + border-top:thin solid #ffffff; |
427 | + border-left:thin solid #ffffff; |
428 | + border-right:thin solid #ffffff; |
429 | +} |
430 | + |
431 | + |
432 | + </style> |
433 | +</head> |
434 | +<body> |
435 | + <%page expression_filter="entity"/> |
436 | + <% |
437 | + def carriage_returns(text): |
438 | + return text.replace('\n', '<br />') |
439 | + |
440 | + %> |
441 | + %for order in objects: |
442 | + <% setLang(order.partner_id.lang) %> |
443 | + <% |
444 | + quotation = order.state == 'draft' |
445 | + %> |
446 | + <div class="address"> |
447 | + <table class="recipient"> |
448 | + <tr><td class="name">${order.partner_id.title or ''} ${order.partner_id.name }</td></tr> |
449 | + <tr><td>${order.partner_id.street or ''}</td></tr> |
450 | + <tr><td>${order.partner_id.street2 or ''}</td></tr> |
451 | + <tr><td>${order.partner_id.zip or ''} ${order.partner_id.city or ''}</td></tr> |
452 | + %if order.partner_id.state_id: |
453 | + <tr><td>${order.partner_id.state_id.name or ''} </td></tr> |
454 | + %endif |
455 | + %if order.partner_id.country_id: |
456 | + <tr><td>${order.partner_id.country_id.name or ''} </td></tr> |
457 | + %endif |
458 | + %if order.partner_id.phone: |
459 | + <tr><td>${_("Tel")}: ${order.partner_id.phone}</td></tr> |
460 | + %endif |
461 | + %if order.partner_id.fax: |
462 | + <tr><td>${_("Fax")}: ${order.partner_id.fax}</td></tr> |
463 | + %endif |
464 | + %if order.partner_id.email: |
465 | + <tr><td>${_("E-mail")}: ${order.partner_id.email}</td></tr> |
466 | + %endif |
467 | + %if order.partner_id.vat: |
468 | + <tr><td>${_("VAT")}: ${order.partner_id.vat}</td></tr> |
469 | + %endif |
470 | + </table> |
471 | + |
472 | + <table class="shipping"> |
473 | + <tr><td class="address_title">${_("Shipping address:")}</td></tr> |
474 | + <tr><td >${order.partner_id.title or ''} ${order.partner_id.name }</td></tr> |
475 | + <tr><td>${order.partner_shipping_id.street or ''}</td></tr> |
476 | + <tr><td>${order.partner_shipping_id.street2 or ''}</td></tr> |
477 | + <tr><td>${order.partner_shipping_id.zip or ''} ${order.partner_shipping_id.city or ''}</td></tr> |
478 | + %if order.partner_shipping_id.state_id: |
479 | + <tr><td>${order.partner_shipping_id.state_id.name or ''} </td></tr> |
480 | + %endif |
481 | + %if order.partner_shipping_id.country_id: |
482 | + <tr><td>${order.partner_shipping_id.country_id.name or ''} </td></tr> |
483 | + %endif |
484 | + </table> |
485 | + |
486 | + <table class="invoice"> |
487 | + <tr><td class="address_title">${_("Invoice address:")}</td></tr> |
488 | + <tr><td>${order.partner_id.title or ''} ${order.partner_id.name }</td></tr> |
489 | + <tr><td>${order.partner_invoice_id.street or ''}</td></tr> |
490 | + <tr><td>${order.partner_invoice_id.street2 or ''}</td></tr> |
491 | + <tr><td>${order.partner_invoice_id.zip or ''} ${order.partner_invoice_id.city or ''}</td></tr> |
492 | + %if order.partner_invoice_id.state_id: |
493 | + <tr><td>${order.partner_invoice_id.state_id.name or ''} </td></tr> |
494 | + %endif |
495 | + %if order.partner_invoice_id.country_id: |
496 | + <tr><td>${order.partner_invoice_id.country_id.name or ''} </td></tr> |
497 | + %endif |
498 | + </table> |
499 | + </div> |
500 | + <div> |
501 | + |
502 | + %if order.note1: |
503 | + <p class="std_text"> ${order.note1| n} </p> |
504 | + %endif |
505 | + </div> |
506 | + |
507 | + <h1 style="clear:both;">${quotation and _(u'Quotation N°') or _(u'Order N°') } ${order.name}</h1> |
508 | + |
509 | + <table class="basic_table" width="100%"> |
510 | + <tr> |
511 | + <td style="font-weight:bold;">${quotation and _("Date Ordered") or _("Quotation Date")}</td> |
512 | + <td style="font-weight:bold;">${_("Your Reference")}</td> |
513 | + <td style="font-weight:bold;">${_("Salesman")}</td> |
514 | + <td style="font-weight:bold;">${_('Payment Term')}</td> |
515 | + <td style="font-weight:bold;">${_('Incoterm')}</td> |
516 | + </tr> |
517 | + <tr> |
518 | + <td>${formatLang(order.date_order, date=True)}</td> |
519 | + <td>${order.client_order_ref or ''}</td> |
520 | + <td>${order.user_id and order.user_id.name or ''}</td> |
521 | + <td>${order.payment_term and order.payment_term.name or ''}</td> |
522 | + <td>${''}</td> |
523 | + </tr> |
524 | + </table> |
525 | + |
526 | + <table class="list_sale_table" width="100%" style="margin-top: 20px;"> |
527 | + <thead> |
528 | + <tr> |
529 | + <th>${_("Description")}</th> |
530 | + <th class="amount">${_("Quantity")}</th> |
531 | + <th class="amount">${_("UoM")}</th> |
532 | + <th class="amount">${_("Unit Price")}</th> |
533 | + <th>${_("VAT")}</th> |
534 | + <th class="amount">${_("Disc.(%)")}</th> |
535 | + <th class="amount">${_("Price")}</th> |
536 | + </tr> |
537 | + </thead> |
538 | + <tbody> |
539 | + %for line in order.order_line: |
540 | + <tr class="line"> |
541 | + <td style="text-align:left; " >${ line.name }</td> |
542 | + <td class="amount" width="7.5%">${ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) }</td> |
543 | + <td style="text-align:center;">${ line.product_uos and line.product_uos.name or line.product_uom.name }</td> |
544 | + <td class="amount" width="8%">${formatLang(line.price_unit)}</td> |
545 | + <td style="font-style:italic; font-size: 10;">${ ', '.join([tax.name or '' for tax in line.tax_id]) }</td> |
546 | + <td class="amount" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Sale Price')) or ''} ${line.discount and '%' or ''}</td> |
547 | + <td class="amount" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td> |
548 | + </tr> |
549 | + %if line.formatted_note: |
550 | + <tr class="line"> |
551 | + <td colspan="7" class="note" style="text-align:left;">${line.formatted_note| n}</td> |
552 | + </tr> |
553 | + %endif |
554 | + %endfor |
555 | + </tbody> |
556 | + <tfoot class="totals"> |
557 | + <tr> |
558 | + <td colspan="5" style="border-style:none"/> |
559 | + <td style="border-style:none"><b>${_("Net Total:")}</b></td> |
560 | + <td class="amount" style="border-style:none">${formatLang(order.amount_untaxed, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td> |
561 | + </tr> |
562 | + <tr> |
563 | + <td colspan="5" style="border-style:none"/> |
564 | + <td style="border-style:none" ><b>${_("Taxes:")}</b></td> |
565 | + <td class="amount"style="border-style:none" >${formatLang(order.amount_tax, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td> |
566 | + </tr> |
567 | + <tr> |
568 | + <td colspan="5" style="border-style:none"/> |
569 | + <td style="border-style:none"><b>${_("Total:")}</b></td> |
570 | + <td class="amount" style="border-style:none">${formatLang(order.amount_total, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td> |
571 | + </tr> |
572 | + </tfoot> |
573 | + </table> |
574 | + <p style="margin-top: 20px;">${order.payment_term and order.payment_term.note or '' | carriage_returns}</p> |
575 | + |
576 | + %if order.note : |
577 | + <p class="std_text">${order.note | carriage_returns}</p> |
578 | + %endif |
579 | + %if order.note2: |
580 | + <p class="std_text">${order.note2 | n}</p> |
581 | + %endif |
582 | + |
583 | + <p style="page-break-after: always"/> |
584 | + <br/> |
585 | + %endfor |
586 | +</body> |
587 | +</html> |
588 | |
589 | === added file 'sale_order_webkit/report/sale_order.py' |
590 | --- sale_order_webkit/report/sale_order.py 1970-01-01 00:00:00 +0000 |
591 | +++ sale_order_webkit/report/sale_order.py 2013-01-25 09:44:22 +0000 |
592 | @@ -0,0 +1,41 @@ |
593 | +# -*- coding: utf-8 -*- |
594 | +############################################################################## |
595 | +# |
596 | +# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) |
597 | +# @author Nicolas Bessi, Vincent Renaville, Guewen Baconnier |
598 | +# |
599 | +# This program is free software: you can redistribute it and/or modify |
600 | +# it under the terms of the GNU Affero General Public License as |
601 | +# published by the Free Software Foundation, either version 3 of the |
602 | +# License, or (at your option) any later version. |
603 | +# |
604 | +# This program is distributed in the hope that it will be useful, |
605 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
606 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
607 | +# GNU Affero General Public License for more details. |
608 | +# |
609 | +# You should have received a copy of the GNU Affero General Public License |
610 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
611 | +# |
612 | +############################################################################## |
613 | +import time |
614 | + |
615 | +from openerp.report import report_sxw |
616 | +from openerp import pooler |
617 | + |
618 | + |
619 | +class SaleOrderReport(report_sxw.rml_parse): |
620 | + def __init__(self, cr, uid, name, context): |
621 | + super(SaleOrderReport, self).__init__(cr, uid, name, context=context) |
622 | + self.localcontext.update({'time': time, |
623 | + 'company_vat': self._get_company_vat}) |
624 | + |
625 | + def _get_company_vat(self): |
626 | + res_users_obj = pooler.get_pool(self.cr.dbname).get('res.users') |
627 | + company_vat = res_users_obj.browse(self.cr, self.uid, self.uid).company_id.partner_id.vat |
628 | + return company_vat |
629 | + |
630 | +report_sxw.report_sxw('report.sale.order.webkit', |
631 | + 'sale.order', |
632 | + 'addons/sale_report_webkit/report/sale_order.mako', |
633 | + parser=SaleOrderReport) |
634 | |
635 | === added file 'sale_order_webkit/sale.py' |
636 | --- sale_order_webkit/sale.py 1970-01-01 00:00:00 +0000 |
637 | +++ sale_order_webkit/sale.py 2013-01-25 09:44:22 +0000 |
638 | @@ -0,0 +1,72 @@ |
639 | +# -*- coding: utf-8 -*- |
640 | +############################################################################## |
641 | +# |
642 | +# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) |
643 | +# @author Nicolas Bessi, Vincent Renaville, Guewen Baconnier |
644 | +# |
645 | +# This program is free software: you can redistribute it and/or modify |
646 | +# it under the terms of the GNU Affero General Public License as |
647 | +# published by the Free Software Foundation, either version 3 of the |
648 | +# License, or (at your option) any later version. |
649 | +# |
650 | +# This program is distributed in the hope that it will be useful, |
651 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
652 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
653 | +# GNU Affero General Public License for more details. |
654 | +# |
655 | +# You should have received a copy of the GNU Affero General Public License |
656 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
657 | +# |
658 | +############################################################################## |
659 | +from openerp.osv import orm, fields |
660 | + |
661 | + |
662 | +class SaleConditionText(orm.Model): |
663 | + """Sale order Textual information""" |
664 | + _name = "sale.condition_text" |
665 | + _description = "sale conditions" |
666 | + |
667 | + _columns = { |
668 | + 'name': fields.char('Condition summary', required=True, size=128), |
669 | + 'type': fields.selection([('header', 'Top condition'), |
670 | + ('footer', 'Bottom condition')], |
671 | + 'type', required=True), |
672 | + 'text': fields.html('Condition', translate=True, required=True)} |
673 | + |
674 | + |
675 | +class SaleOrder(orm.Model): |
676 | + """Adds condition to SO""" |
677 | + |
678 | + _inherit = "sale.order" |
679 | + _description = 'Sale Order' |
680 | + |
681 | + _columns = {'text_condition1': fields.many2one('sale.condition_text', 'Header'), |
682 | + 'text_condition2': fields.many2one('sale.condition_text', 'Footer'), |
683 | + 'note1': fields.html('Header'), |
684 | + 'note2': fields.html('Footer')} |
685 | + |
686 | + def _set_condition(self, cursor, uid, inv_id, commentid, key): |
687 | + """Set the text of the notes in invoices""" |
688 | + if not commentid: |
689 | + return {} |
690 | + try: |
691 | + lang = self.browse(cursor, uid, inv_id)[0].partner_id.lang |
692 | + except Exception, exc: |
693 | + lang = 'en_US' |
694 | + cond = self.pool.get('sale.condition_text').browse(cursor, uid, |
695 | + commentid, {'lang': lang}) |
696 | + return {'value': {key: cond.text}} |
697 | + |
698 | + def set_header(self, cursor, uid, inv_id, commentid): |
699 | + return self._set_condition(cursor, uid, inv_id, commentid, 'note1') |
700 | + |
701 | + def set_footer(self, cursor, uid, inv_id, commentid): |
702 | + return self._set_condition(cursor, uid, inv_id, commentid, 'note2') |
703 | + |
704 | + |
705 | +class SaleOrderLine(orm.Model): |
706 | + """ADD HTML note to sale order lines""" |
707 | + |
708 | + _inherit = "sale.order.line" |
709 | + |
710 | + _columns = {'formatted_note': fields.html('Formatted Note')} |
711 | |
712 | === added file 'sale_order_webkit/sale_report.xml' |
713 | --- sale_order_webkit/sale_report.xml 1970-01-01 00:00:00 +0000 |
714 | +++ sale_order_webkit/sale_report.xml 2013-01-25 09:44:22 +0000 |
715 | @@ -0,0 +1,13 @@ |
716 | +<?xml version="1.0" encoding="utf-8"?> |
717 | +<openerp> |
718 | + <data> |
719 | + <report id="sale.report_sale_order" |
720 | + name="sale.order.webkit" |
721 | + auto="False" |
722 | + model="sale.order" |
723 | + file="sale_order_webkit/report/sale_order.mako" |
724 | + string="Quotation - Order" |
725 | + webkit_header="base_headers_webkit.base_reports_portrait_header" |
726 | + report_type="webkit"/> |
727 | + </data> |
728 | +</openerp> |
729 | |
730 | === added directory 'sale_order_webkit/view' |
731 | === added file 'sale_order_webkit/view/sale_view.xml' |
732 | --- sale_order_webkit/view/sale_view.xml 1970-01-01 00:00:00 +0000 |
733 | +++ sale_order_webkit/view/sale_view.xml 2013-01-25 09:44:22 +0000 |
734 | @@ -0,0 +1,84 @@ |
735 | +<?xml version="1.0"?> |
736 | +<openerp> |
737 | + <data> |
738 | + <!-- Sale condition text views --> |
739 | + <record model="ir.ui.view" id="view_sale_condition_webkit"> |
740 | + <field name="name">sale.condition_text.form</field> |
741 | + <field name="model">sale.condition_text</field> |
742 | + <field name="type">form</field> |
743 | + <field name="arch" type="xml"> |
744 | + <form string="sale condition text"> |
745 | + <field name="name" select="1"/> |
746 | + <field name="type" select="1"/> |
747 | + <field name="text" colspan="4"/> |
748 | + </form> |
749 | + </field> |
750 | + </record> |
751 | + <record model="ir.ui.view" id="view_sale_condition_list_webkit"> |
752 | + <field name="name">sale.condition_text.list</field> |
753 | + <field name="model">sale.condition_text</field> |
754 | + <field name="type">tree</field> |
755 | + <field name="priority" eval="6"/> |
756 | + <field name="arch" type="xml"> |
757 | + <tree string="Sale condition text"> |
758 | + <field name="name" select="1"/> |
759 | + <field name="type" select="1"/> |
760 | + <field name="text"/> |
761 | + </tree> |
762 | + </field> |
763 | + </record> |
764 | + <record model="ir.actions.act_window" id="action_sale_condition_webkit"> |
765 | + <field name="name">sale.condition_text</field> |
766 | + <field name="type">ir.actions.act_window</field> |
767 | + <field name="res_model">sale.condition_text</field> |
768 | + <field name="view_type">form</field> |
769 | + <field name="view_mode">tree,form</field> |
770 | + <field name="view_id" ref="view_sale_condition_list_webkit"/> |
771 | + </record> |
772 | + <record model="ir.actions.act_window" id="action_sale_condition_form_webkit"> |
773 | + <field name="name">sale.condition_text</field> |
774 | + <field name="type">ir.actions.act_window</field> |
775 | + <field name="res_model">sale.condition_text</field> |
776 | + <field name="view_type">form</field> |
777 | + <field name="view_id" ref="view_sale_condition_webkit"/> |
778 | + </record> |
779 | + |
780 | + <!-- Overwrite of sale order / sale order line form view --> |
781 | + |
782 | + |
783 | + <record model="ir.ui.view" id="sale_order_add_notes_in_invoice_line_1"> |
784 | + <field name="name">sale.odrer.form.add.notes</field> |
785 | + <field name="model">sale.order</field> |
786 | + <field name="inherit_id" ref="sale.view_order_form"/> |
787 | + <field name="arch" type="xml"> |
788 | + <xpath expr="/form/sheet/notebook/page/field/form/field[@name='name']" position="after"> |
789 | + <group> |
790 | + <field name="formatted_note" colspan="4"/> |
791 | + </group> |
792 | + </xpath> |
793 | + </field> |
794 | + </record> |
795 | + |
796 | + <record model="ir.ui.view" id="view_order_form"> |
797 | + <field name="name">sale.order.form.add.notes</field> |
798 | + <field name="model">sale.order</field> |
799 | + <field name="inherit_id" ref="sale.view_order_form"/> |
800 | + <field name="arch" type="xml"> |
801 | + <notebook position="inside"> |
802 | + <page string="Conditions"> |
803 | + <group> |
804 | + <field name="text_condition1" domain="[('type','=','header')]" |
805 | + on_change="set_header(text_condition1)" colspan="2"/> |
806 | + <field name="text_condition2" domain="[('type','=','footer')]" |
807 | + on_change="set_footer(text_condition2)" colspan="2"/> |
808 | + <field name="note1" colspan="4" nolabel="1" placeholder="Your top conditions here"/> |
809 | + <field name="note2" colspan="4" nolabel="1" placeholder="Your bottom conditions here"/> |
810 | + </group> |
811 | + </page> |
812 | + </notebook> |
813 | + </field> |
814 | + </record> |
815 | + |
816 | + |
817 | + </data> |
818 | +</openerp> |
LGTM
I just think the dependancies on 'base' and 'report_webkit' modules aren't necessary in __openerp__.py as already inherited from base_header_webkit