Merge lp:~carlos-realsystems/openerp-vauxoo-gbw/6.0 into lp:openerp-vauxoo-gbw/6.0
- 6.0
- Merge into openerp-vauxoo-gbw
Proposed by
Carlos Contreras
Status: | Merged |
---|---|
Merged at revision: | 3 |
Proposed branch: | lp:~carlos-realsystems/openerp-vauxoo-gbw/6.0 |
Merge into: | lp:openerp-vauxoo-gbw/6.0 |
Diff against target: |
1153 lines (+854/-86) 18 files modified
gbwinvoice_report_webkit/__init__.py (+2/-1) gbwinvoice_report_webkit/__openerp__.py (+19/-9) gbwinvoice_report_webkit/data.xml (+150/-1) gbwinvoice_report_webkit/gbwcategory_report.py (+4/-0) gbwinvoice_report_webkit/gbwinvoice_report_webkit_view.xml (+20/-1) gbwinvoice_report_webkit/i18n/en_US.po (+102/-2) gbwinvoice_report_webkit/i18n/es_MX.po (+102/-2) gbwinvoice_report_webkit/report/__init__.py (+1/-1) gbwinvoice_report_webkit/report/gbwinvoice_report_webkit.py (+0/-17) gbwinvoice_report_webkit/report/templates/gbwcategory_report_webkit.mako (+73/-28) gbwinvoice_report_webkit/report/templates/gbwcategorydetail_report_webkit.mako (+122/-0) gbwinvoice_report_webkit/report/templates/gbwinvoice_report_webkit.mako (+47/-24) gbwinvoice_report_webkit/wizard/__init__.py (+2/-0) gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard.py (+65/-0) gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard_view.xml (+46/-0) gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.py (+45/-0) gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.xml (+9/-0) gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard_view.xml (+45/-0) |
To merge this branch: | bzr merge lp:~carlos-realsystems/openerp-vauxoo-gbw/6.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Moisés López - http://www.vauxoo.com | Pending | ||
Review via email: mp+167412@code.launchpad.net |
Commit message
Description of the change
[IMP] Show product code on Report Detail by Category.
Show product name to 15 characters
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'gbwinvoice_report_webkit/__init__.py' |
2 | --- gbwinvoice_report_webkit/__init__.py 2013-05-27 18:43:36 +0000 |
3 | +++ gbwinvoice_report_webkit/__init__.py 2013-06-04 21:36:25 +0000 |
4 | @@ -28,5 +28,6 @@ |
5 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6 | # |
7 | ############################################################################## |
8 | +import report |
9 | import wizard |
10 | -import report |
11 | \ No newline at end of file |
12 | +import gbwcategory_report |
13 | |
14 | === modified file 'gbwinvoice_report_webkit/__openerp__.py' |
15 | --- gbwinvoice_report_webkit/__openerp__.py 2013-05-27 18:43:36 +0000 |
16 | +++ gbwinvoice_report_webkit/__openerp__.py 2013-06-04 21:36:25 +0000 |
17 | @@ -33,22 +33,30 @@ |
18 | "description" : """ Invoce Report for GBW |
19 | This module adds the follow reports : |
20 | - Invoices by period |
21 | + - Invoices by product category |
22 | + - Invoices by product category with detail |
23 | |
24 | Goals: |
25 | |
26 | - * Give to GBW invoice report like actual GBW System: ADMIN |
27 | - |
28 | -TODO: |
29 | - - Filter by period in the wizard (no need to go to the Invoices anymore) or by view |
30 | - - improved report style |
31 | - |
32 | + * Show GBW invoice report and invoice report by category like actual GBW System: ADMIN |
33 | + |
34 | +Instalation: |
35 | +Once upon installed go to: |
36 | + Administration->Customization->Low level objects->Actions->Reports |
37 | + |
38 | + Change header of: |
39 | + GBW Category Detail Invoice Report |
40 | + GBW Category Invoice Report |
41 | + GBW Invoice Report |
42 | + to: |
43 | + GBW Invoice NO Header |
44 | + |
45 | Limitations: |
46 | In order to run properly this module make sure you have installed the library ‘wkhtmltopdf’ for the pdf rendering (this library path must be added to you company settings). |
47 | |
48 | html headers and footers are deactivated for these reports because of an issue of wkhtmltopdf : http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 |
49 | Instead, the header and footer are created as text with arguments passed to wkhtmltopdf. The texts are defined inside the report classes. |
50 | - |
51 | - You have to create the print buttons by calling the wizard. |
52 | + |
53 | """, |
54 | "version" : "0.1", |
55 | "depends" : ["base", "account", "report_webkit"], |
56 | @@ -56,8 +64,10 @@ |
57 | "author" : "Real Systems", |
58 | "url": "http://www.realsystems.com.mx/", |
59 | "data": ["gbwinvoice_report_webkit_view.xml", |
60 | - "data.xml", |
61 | + "data.xml", |
62 | ], |
63 | + "init_xml" : ['wizard/gbwinvoice_report_webkit_wizard_view.xml', |
64 | + 'wizard/gbwcategory_report_webkit_wizard_view.xml'], |
65 | "installable" : True, |
66 | "active" : False, |
67 | "certificate" : "", |
68 | |
69 | === modified file 'gbwinvoice_report_webkit/data.xml' |
70 | --- gbwinvoice_report_webkit/data.xml 2013-05-27 18:43:36 +0000 |
71 | +++ gbwinvoice_report_webkit/data.xml 2013-06-04 21:36:25 +0000 |
72 | @@ -1,6 +1,9 @@ |
73 | <?xml version="1.0" ?> |
74 | <openerp> |
75 | <data noupdate="1"> |
76 | + |
77 | +<!-- Normal GBW Header !--> |
78 | + |
79 | <record id="ir_header_gbw" model="ir.header_webkit"> |
80 | <field name="footer_html"><![CDATA[<html> |
81 | <head> |
82 | @@ -161,7 +164,153 @@ |
83 | .tax { |
84 | width:50%; |
85 | }]]> </field> |
86 | - <field eval=""""GBW Invoice Header"""" name="name"/> |
87 | + <field eval=""""GBW Normal Header"""" name="name"/> |
88 | + </record> |
89 | + |
90 | +<!-- GBW Header without company data !--> |
91 | + |
92 | + <record id="ir_noheader_gbw" model="ir.header_webkit"> |
93 | + <field name="footer_html"><![CDATA[<html> |
94 | + <head> |
95 | + <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> |
96 | + <script> |
97 | + function subst() { |
98 | + var vars={}; |
99 | + var x=document.location.search.substring(1).split('&'); |
100 | + for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} |
101 | + var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; |
102 | + for(var i in x) { |
103 | + var y = document.getElementsByClassName(x[i]); |
104 | + for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; |
105 | + } |
106 | + } |
107 | + </script> |
108 | + </head> |
109 | + <body style="border:0; margin: 0;" onload="subst()"> |
110 | + <table style="border-top: 1px solid black; width: 100%"> |
111 | + <tr > |
112 | + <td style="text-align:right;font-size:12;" width="95%">Page <span class="page"/></td><td style="text-align:left;font-size:12;"> of <span class="topage"/></td> |
113 | + </tr> |
114 | + </table> |
115 | + </body> |
116 | +</html>]]></field> |
117 | + <field eval=""""Portrait"""" name="orientation"/> |
118 | + <field eval=""""A4"""" name="format"/> |
119 | + <field name="html"><![CDATA[<html> |
120 | + <head> |
121 | + <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> |
122 | + <script> |
123 | + function subst() { |
124 | + var vars={}; |
125 | + var x=document.location.search.substring(1).split('&'); |
126 | + for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} |
127 | + var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; |
128 | + for(var i in x) { |
129 | + var y = document.getElementsByClassName(x[i]); |
130 | + for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; |
131 | + } |
132 | + } |
133 | + </script> |
134 | + <style type="text/css"> |
135 | + ${css} |
136 | + </style> |
137 | + </head> |
138 | + <body style="border:0; margin: 0;" onload="subst()"> |
139 | + <% setLang(user.context_lang) %> |
140 | + <table class="header" style="border-bottom: 0px solid black; width: 100%"> |
141 | + <tr> |
142 | + <td> </td> |
143 | + <td style="text-align:right">Fecha: ${ formatLang(time.strftime("%Y-%m-%d"), date=True) }<br>IMPRIMIÓ: ${user.name}</td> |
144 | + </tr> |
145 | + </table> ${_debug or ''|n} </body> |
146 | +</html>]]> |
147 | +</field> |
148 | + <field eval="55.0" name="margin_top"/> |
149 | + <field name="css" ><![CDATA[ |
150 | +body { |
151 | +font-family:helvetica; |
152 | +font-size:12; |
153 | +} |
154 | + |
155 | + |
156 | +.dest_address { |
157 | +margin-left:60%; |
158 | +font-size:12; |
159 | +} |
160 | +.header { |
161 | +margin-left:0; |
162 | +text-align:left; |
163 | +width:300px; |
164 | +font-size:12; |
165 | +} |
166 | + |
167 | +.title { |
168 | +font-size:16; |
169 | +font-weight: bold; |
170 | + |
171 | +} |
172 | + |
173 | + |
174 | +.basic_table{ |
175 | +text-align:center; |
176 | +border:1px solid lightGrey; |
177 | +border-collapse: collapse; |
178 | +} |
179 | +.basic_table td { |
180 | +border:1px solid lightGrey; |
181 | +font-size:12; |
182 | + |
183 | + |
184 | +} |
185 | + |
186 | +.list_table { |
187 | +border-color:black; |
188 | +text-align:center; |
189 | +border-collapse: collapse; |
190 | + |
191 | +} |
192 | +.list_table td { |
193 | +border-color:gray; |
194 | +border-top:1px solid gray; |
195 | +text-align:left; |
196 | +font-size:12; |
197 | +padding-right:3px |
198 | +padding-left:3px |
199 | +padding-top:3px |
200 | +padding-bottom:3px |
201 | +} |
202 | + |
203 | +.list_table th { |
204 | +border-bottom:2px solid black; |
205 | +text-align:left; |
206 | +font-size:12; |
207 | +font-weight:bold; |
208 | +padding-right:3px |
209 | +padding-left:3px |
210 | +} |
211 | + |
212 | +.list_tabe thead { |
213 | + display:table-header-group; |
214 | +} |
215 | + |
216 | + |
217 | +.total { |
218 | +width:100%; |
219 | +} |
220 | +.lib { |
221 | +width:10.3%; |
222 | +} |
223 | +.tot { |
224 | +text-align:right; |
225 | +width:15%; |
226 | +} |
227 | +.lefttot { |
228 | +width:74%; |
229 | +} |
230 | +.tax { |
231 | +width:50%; |
232 | +}]]> </field> |
233 | + <field eval=""""GBW Invoice NO Header"""" name="name"/> |
234 | </record> |
235 | |
236 | <record id="ir_header_img_gbw" model="ir.header_img"> |
237 | |
238 | === added file 'gbwinvoice_report_webkit/gbwcategory_report.py' |
239 | --- gbwinvoice_report_webkit/gbwcategory_report.py 1970-01-01 00:00:00 +0000 |
240 | +++ gbwinvoice_report_webkit/gbwcategory_report.py 2013-06-04 21:36:25 +0000 |
241 | @@ -0,0 +1,4 @@ |
242 | +from osv import osv,fields |
243 | +from tools.translate import _ |
244 | +import time |
245 | +from datetime import datetime |
246 | |
247 | === modified file 'gbwinvoice_report_webkit/gbwinvoice_report_webkit_view.xml' |
248 | --- gbwinvoice_report_webkit/gbwinvoice_report_webkit_view.xml 2013-05-28 18:55:31 +0000 |
249 | +++ gbwinvoice_report_webkit/gbwinvoice_report_webkit_view.xml 2013-06-04 21:36:25 +0000 |
250 | @@ -5,9 +5,28 @@ |
251 | id="gbwinvoice_report_webkit" |
252 | model="account.invoice" |
253 | name="gbwinvoice.report.webkit" |
254 | - file="gbwinvoice_report_webkit/report/invoice_gbw_report.mako" |
255 | + file="gbwinvoice_report_webkit/report/templates/gbwinvoice_report_webkit.mako" |
256 | string="GBW Invoice Report" |
257 | report_type="webkit" |
258 | /> |
259 | + |
260 | + <report auto="False" |
261 | + id="gbwcategory_report_webkit" |
262 | + model="account.invoice.line" |
263 | + name="gbwcategory.report.webkit" |
264 | + file="gbwinvoice_report_webkit/report/templates/gbwcategory_report_webkit.mako" |
265 | + string="GBW Category Invoice Report" |
266 | + report_type="webkit" |
267 | + /> |
268 | + |
269 | + <report auto="False" |
270 | + id="gbwcategorydetail_report_webkit" |
271 | + model="account.invoice.line" |
272 | + name="gbwcategorydetail.report.webkit" |
273 | + file="gbwinvoice_report_webkit/report/templates/gbwcategorydetail_report_webkit.mako" |
274 | + string="GBW Category Detail Invoice Report" |
275 | + report_type="webkit" |
276 | + /> |
277 | + |
278 | </data> |
279 | </openerp> |
280 | |
281 | === modified file 'gbwinvoice_report_webkit/i18n/en_US.po' |
282 | --- gbwinvoice_report_webkit/i18n/en_US.po 2013-05-27 18:43:36 +0000 |
283 | +++ gbwinvoice_report_webkit/i18n/en_US.po 2013-06-04 21:36:25 +0000 |
284 | @@ -6,8 +6,8 @@ |
285 | msgstr "" |
286 | "Project-Id-Version: OpenERP Server 6.0.4\n" |
287 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
288 | -"POT-Creation-Date: 2013-05-27 17:04+0000\n" |
289 | -"PO-Revision-Date: 2013-05-27 17:04+0000\n" |
290 | +"POT-Creation-Date: 2013-06-04 17:52+0000\n" |
291 | +"PO-Revision-Date: 2013-06-04 17:52+0000\n" |
292 | "Last-Translator: <>\n" |
293 | "Language-Team: \n" |
294 | "MIME-Version: 1.0\n" |
295 | @@ -16,7 +16,107 @@ |
296 | "Plural-Forms: \n" |
297 | |
298 | #. module: gbwinvoice_report_webkit |
299 | +#: field:gbwcategory.webkitwizard,state:0 |
300 | +#: field:gbwinvoice.webkitwizard,state:0 |
301 | +msgid "unknown" |
302 | +msgstr "unknown" |
303 | + |
304 | +#. module: gbwinvoice_report_webkit |
305 | +#: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwcategory_report_webkit |
306 | +msgid "GBW Category Invoice Report" |
307 | +msgstr "GBW Category Invoice Report" |
308 | + |
309 | +#. module: gbwinvoice_report_webkit |
310 | +#: field:gbwcategory.webkitwizard,from_date:0 |
311 | +#: field:gbwinvoice.webkitwizard,from_date:0 |
312 | +msgid "From" |
313 | +msgstr "From" |
314 | + |
315 | +#. module: gbwinvoice_report_webkit |
316 | +#: field:gbwcategory.webkitwizard,report_title:0 |
317 | +#: field:gbwinvoice.webkitwizard,report_title:0 |
318 | +msgid "Report Title" |
319 | +msgstr "Report Title" |
320 | + |
321 | +#. module: gbwinvoice_report_webkit |
322 | +#: model:ir.model,name:gbwinvoice_report_webkit.model_gbwcategory_webkitwizard |
323 | +msgid "GBW Invoices by Category" |
324 | +msgstr "GBW Invoices by Category" |
325 | + |
326 | +#. module: gbwinvoice_report_webkit |
327 | +#: view:gbwcategory.webkitwizard:0 |
328 | +#: view:gbwinvoice.webkitwizard:0 |
329 | +msgid "Invoices" |
330 | +msgstr "Invoices" |
331 | + |
332 | +#. module: gbwinvoice_report_webkit |
333 | +#: help:gbwcategory.webkitwizard,detail_report:0 |
334 | +msgid "Show products detail by category." |
335 | +msgstr "Show products detail by category." |
336 | + |
337 | +#. module: gbwinvoice_report_webkit |
338 | +#: view:gbwcategory.webkitwizard:0 |
339 | +#: view:gbwinvoice.webkitwizard:0 |
340 | +msgid "Create" |
341 | +msgstr "Create" |
342 | + |
343 | +#. module: gbwinvoice_report_webkit |
344 | +#: selection:gbwcategory.webkitwizard,state:0 |
345 | +#: selection:gbwinvoice.webkitwizard,state:0 |
346 | +msgid "get" |
347 | +msgstr "get" |
348 | + |
349 | +#. module: gbwinvoice_report_webkit |
350 | +#: field:gbwcategory.webkitwizard,detail_report:0 |
351 | +msgid "Show Products Detail" |
352 | +msgstr "Show Products Detail" |
353 | + |
354 | +#. module: gbwinvoice_report_webkit |
355 | #: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwinvoice_report_webkit |
356 | msgid "GBW Invoice Report" |
357 | msgstr "GBW Invoice Report" |
358 | |
359 | +#. module: gbwinvoice_report_webkit |
360 | +#: view:gbwcategory.webkitwizard:0 |
361 | +#: view:gbwinvoice.webkitwizard:0 |
362 | +msgid "Filter" |
363 | +msgstr "Filter" |
364 | + |
365 | +#. module: gbwinvoice_report_webkit |
366 | +#: field:gbwcategory.webkitwizard,to_date:0 |
367 | +#: field:gbwinvoice.webkitwizard,to_date:0 |
368 | +msgid "To" |
369 | +msgstr "To" |
370 | + |
371 | +#. module: gbwinvoice_report_webkit |
372 | +#: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwcategorydetail_report_webkit |
373 | +msgid "GBW Category Detail Invoice Report" |
374 | +msgstr "GBW Category Detail Invoice Report" |
375 | + |
376 | +#. module: gbwinvoice_report_webkit |
377 | +#: selection:gbwcategory.webkitwizard,state:0 |
378 | +#: selection:gbwinvoice.webkitwizard,state:0 |
379 | +msgid "choose" |
380 | +msgstr "choose" |
381 | + |
382 | +#. module: gbwinvoice_report_webkit |
383 | +#: model:ir.actions.act_window,name:gbwinvoice_report_webkit.action_gbwinvoice_report_webkit |
384 | +msgid "GBW Invoice Report by Period" |
385 | +msgstr "GBW Invoice Report by Period" |
386 | + |
387 | +#. module: gbwinvoice_report_webkit |
388 | +#: view:gbwcategory.webkitwizard:0 |
389 | +#: view:gbwinvoice.webkitwizard:0 |
390 | +msgid "Cancel" |
391 | +msgstr "Cancel" |
392 | + |
393 | +#. module: gbwinvoice_report_webkit |
394 | +#: model:ir.actions.act_window,name:gbwinvoice_report_webkit.action_gbwcategory_report_webkit |
395 | +msgid "GBW Invoice Report by Category" |
396 | +msgstr "GBW Invoice Report by Category" |
397 | + |
398 | +#. module: gbwinvoice_report_webkit |
399 | +#: model:ir.model,name:gbwinvoice_report_webkit.model_gbwinvoice_webkitwizard |
400 | +msgid "GBW Invoices by Period" |
401 | +msgstr "GBW Invoices by Period" |
402 | + |
403 | |
404 | === modified file 'gbwinvoice_report_webkit/i18n/es_MX.mo' |
405 | Binary files gbwinvoice_report_webkit/i18n/es_MX.mo 2013-05-27 18:43:36 +0000 and gbwinvoice_report_webkit/i18n/es_MX.mo 2013-06-04 21:36:25 +0000 differ |
406 | === modified file 'gbwinvoice_report_webkit/i18n/es_MX.po' |
407 | --- gbwinvoice_report_webkit/i18n/es_MX.po 2013-05-27 18:43:36 +0000 |
408 | +++ gbwinvoice_report_webkit/i18n/es_MX.po 2013-06-04 21:36:25 +0000 |
409 | @@ -6,8 +6,8 @@ |
410 | msgstr "" |
411 | "Project-Id-Version: OpenERP Server 6.0.4\n" |
412 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
413 | -"POT-Creation-Date: 2013-05-27 17:05+0000\n" |
414 | -"PO-Revision-Date: 2013-05-27 12:46-0600\n" |
415 | +"POT-Creation-Date: 2013-06-04 17:52+0000\n" |
416 | +"PO-Revision-Date: 2013-06-04 13:03-0600\n" |
417 | "Last-Translator: Carlos Enrique Contreras Vara <carlosecv@realsystems.com.mx>\n" |
418 | "Language-Team: \n" |
419 | "MIME-Version: 1.0\n" |
420 | @@ -16,7 +16,107 @@ |
421 | "Plural-Forms: \n" |
422 | |
423 | #. module: gbwinvoice_report_webkit |
424 | +#: field:gbwcategory.webkitwizard,state:0 |
425 | +#: field:gbwinvoice.webkitwizard,state:0 |
426 | +msgid "unknown" |
427 | +msgstr "desconocido" |
428 | + |
429 | +#. module: gbwinvoice_report_webkit |
430 | +#: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwcategory_report_webkit |
431 | +msgid "GBW Category Invoice Report" |
432 | +msgstr "Reporte por Categorías GBW" |
433 | + |
434 | +#. module: gbwinvoice_report_webkit |
435 | +#: field:gbwcategory.webkitwizard,from_date:0 |
436 | +#: field:gbwinvoice.webkitwizard,from_date:0 |
437 | +msgid "From" |
438 | +msgstr "Desde" |
439 | + |
440 | +#. module: gbwinvoice_report_webkit |
441 | +#: field:gbwcategory.webkitwizard,report_title:0 |
442 | +#: field:gbwinvoice.webkitwizard,report_title:0 |
443 | +msgid "Report Title" |
444 | +msgstr "Título del Reporte" |
445 | + |
446 | +#. module: gbwinvoice_report_webkit |
447 | +#: model:ir.model,name:gbwinvoice_report_webkit.model_gbwcategory_webkitwizard |
448 | +msgid "GBW Invoices by Category" |
449 | +msgstr "Facturas por Categorías GBW" |
450 | + |
451 | +#. module: gbwinvoice_report_webkit |
452 | +#: view:gbwcategory.webkitwizard:0 |
453 | +#: view:gbwinvoice.webkitwizard:0 |
454 | +msgid "Invoices" |
455 | +msgstr "Facturas" |
456 | + |
457 | +#. module: gbwinvoice_report_webkit |
458 | +#: help:gbwcategory.webkitwizard,detail_report:0 |
459 | +msgid "Show products detail by category." |
460 | +msgstr "Muestra el detalle de los productos por categoría." |
461 | + |
462 | +#. module: gbwinvoice_report_webkit |
463 | +#: view:gbwcategory.webkitwizard:0 |
464 | +#: view:gbwinvoice.webkitwizard:0 |
465 | +msgid "Create" |
466 | +msgstr "Crear" |
467 | + |
468 | +#. module: gbwinvoice_report_webkit |
469 | +#: selection:gbwcategory.webkitwizard,state:0 |
470 | +#: selection:gbwinvoice.webkitwizard,state:0 |
471 | +msgid "get" |
472 | +msgstr "get" |
473 | + |
474 | +#. module: gbwinvoice_report_webkit |
475 | +#: field:gbwcategory.webkitwizard,detail_report:0 |
476 | +msgid "Show Products Detail" |
477 | +msgstr "Muestra el detalle de Productos" |
478 | + |
479 | +#. module: gbwinvoice_report_webkit |
480 | #: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwinvoice_report_webkit |
481 | msgid "GBW Invoice Report" |
482 | msgstr "Reporte de Facturas GBW " |
483 | |
484 | +#. module: gbwinvoice_report_webkit |
485 | +#: view:gbwcategory.webkitwizard:0 |
486 | +#: view:gbwinvoice.webkitwizard:0 |
487 | +msgid "Filter" |
488 | +msgstr "Filtro" |
489 | + |
490 | +#. module: gbwinvoice_report_webkit |
491 | +#: field:gbwcategory.webkitwizard,to_date:0 |
492 | +#: field:gbwinvoice.webkitwizard,to_date:0 |
493 | +msgid "To" |
494 | +msgstr "Hasta" |
495 | + |
496 | +#. module: gbwinvoice_report_webkit |
497 | +#: model:ir.actions.report.xml,name:gbwinvoice_report_webkit.gbwcategorydetail_report_webkit |
498 | +msgid "GBW Category Detail Invoice Report" |
499 | +msgstr "Reporte Detallado por Categoría GBW" |
500 | + |
501 | +#. module: gbwinvoice_report_webkit |
502 | +#: selection:gbwcategory.webkitwizard,state:0 |
503 | +#: selection:gbwinvoice.webkitwizard,state:0 |
504 | +msgid "choose" |
505 | +msgstr "elegir" |
506 | + |
507 | +#. module: gbwinvoice_report_webkit |
508 | +#: model:ir.actions.act_window,name:gbwinvoice_report_webkit.action_gbwinvoice_report_webkit |
509 | +msgid "GBW Invoice Report by Period" |
510 | +msgstr "Facturas por Periodo GBW" |
511 | + |
512 | +#. module: gbwinvoice_report_webkit |
513 | +#: view:gbwcategory.webkitwizard:0 |
514 | +#: view:gbwinvoice.webkitwizard:0 |
515 | +msgid "Cancel" |
516 | +msgstr "Cancelar" |
517 | + |
518 | +#. module: gbwinvoice_report_webkit |
519 | +#: model:ir.actions.act_window,name:gbwinvoice_report_webkit.action_gbwcategory_report_webkit |
520 | +msgid "GBW Invoice Report by Category" |
521 | +msgstr "Reporte por Categorías GBW" |
522 | + |
523 | +#. module: gbwinvoice_report_webkit |
524 | +#: model:ir.model,name:gbwinvoice_report_webkit.model_gbwinvoice_webkitwizard |
525 | +msgid "GBW Invoices by Period" |
526 | +msgstr "Facturas por Período GBW" |
527 | + |
528 | |
529 | === modified file 'gbwinvoice_report_webkit/report/__init__.py' |
530 | --- gbwinvoice_report_webkit/report/__init__.py 2013-05-27 18:43:36 +0000 |
531 | +++ gbwinvoice_report_webkit/report/__init__.py 2013-06-04 21:36:25 +0000 |
532 | @@ -29,4 +29,4 @@ |
533 | # |
534 | ############################################################################## |
535 | |
536 | -import gbwinvoice_report_webkit |
537 | + |
538 | |
539 | === removed file 'gbwinvoice_report_webkit/report/gbwinvoice_report_webkit.py' |
540 | --- gbwinvoice_report_webkit/report/gbwinvoice_report_webkit.py 2013-05-27 18:43:36 +0000 |
541 | +++ gbwinvoice_report_webkit/report/gbwinvoice_report_webkit.py 1970-01-01 00:00:00 +0000 |
542 | @@ -1,17 +0,0 @@ |
543 | -import time |
544 | -from report import report_sxw |
545 | -from osv import osv |
546 | - |
547 | -class gbwinvoice_report_webkit(report_sxw.rml_parse): |
548 | - def __init__(self, cr, uid, name, context): |
549 | - super(gbwinvoice_report_webkit, self).__init__(cr, uid, name, context=context) |
550 | - self.localcontext.update({ |
551 | - 'time': time, |
552 | - 'cr':cr, |
553 | - 'uid': uid, |
554 | - }) |
555 | - |
556 | -report_sxw.report_sxw('report.webkitgbw.invoice', |
557 | - 'account.invoice', |
558 | - 'gbwinvoice_report_webkit/report/invoice_gbw_report.mako', |
559 | - gbwinvoice_report_webkit) |
560 | |
561 | === renamed file 'gbwinvoice_report_webkit/report/templates/category_gbw_report.mako' => 'gbwinvoice_report_webkit/report/templates/gbwcategory_report_webkit.mako' |
562 | --- gbwinvoice_report_webkit/report/templates/category_gbw_report.mako 2013-05-27 18:43:36 +0000 |
563 | +++ gbwinvoice_report_webkit/report/templates/gbwcategory_report_webkit.mako 2013-06-04 21:36:25 +0000 |
564 | @@ -1,41 +1,86 @@ |
565 | <html > |
566 | <body> |
567 | + |
568 | <% |
569 | - renglones = 0 |
570 | - total_importe = 0 |
571 | - total_iva= 0 |
572 | - total_total= 0 |
573 | - facturas = 0 |
574 | - facturas_reportadas = 0 |
575 | - facturas_borrador = 0 |
576 | - facturas_canceladas = 0 |
577 | - setLang(user.context_lang) |
578 | +existe=0 |
579 | +categorias={} |
580 | +registros=0 |
581 | +suma_total_cantidad=0 |
582 | +suma_total_subtotal=0 |
583 | +subtotal=0 |
584 | +setLang(user.context_lang) |
585 | %> |
586 | + |
587 | +<table style="align:right;" > |
588 | +<tr> |
589 | +<td style="font-size:small;" colspan=2>${data['form']['report_title'] or ''}</td> |
590 | +</tr> |
591 | +<tr> |
592 | +<td style="font-size:small;" >Del </td><td>${data['form']['from_date'] or '' }</td> |
593 | +<td style="font-size:small;" > al </td><td>${data['form']['to_date'] or '' }</td> |
594 | +</tr> |
595 | +</table> |
596 | + |
597 | + |
598 | <table class="list_table" > |
599 | <tr> |
600 | <td style="border-bottom:2px solid;" >Categoria</td> |
601 | -<td style="border-bottom:2px solid;" >Producto</td> |
602 | <td style="border-bottom:2px solid;" >Cantidad</td> |
603 | <td style="border-bottom:2px solid;" >Importe</td> |
604 | -<td style="border-bottom:2px solid;" >Impuesto</td> |
605 | -<td style="border-bottom:2px solid;" >Importe Total</td> |
606 | </tr> |
607 | %for involn in objects: |
608 | -<tr> |
609 | -<td style="border-bottom:2px solid;" > |
610 | -${involn.categ_id.name} |
611 | -</td> |
612 | -<td style="border-bottom:2px solid;" >${involn.product_id.name}</td> |
613 | -<td style="border-bottom:2px solid;" ></td> |
614 | -<td style="border-bottom:2px solid;" ></td> |
615 | -<td style="border-bottom:2px solid;" ></td> |
616 | -<td style="border-bottom:2px solid;" ></td> |
617 | -</tr> |
618 | - |
619 | - |
620 | -<% renglones = renglones + 1 %> |
621 | -%endfor |
622 | -</table> |
623 | -</p> |
624 | + <% |
625 | + existe=0 |
626 | + t={} |
627 | + %> |
628 | + %if involn.invoice_id.rate>0.0: |
629 | + <% |
630 | + subtotal=involn.price_subtotal*involn.invoice_id.rate |
631 | + %> |
632 | + %else: |
633 | + <% |
634 | + subtotal=involn.price_subtotal |
635 | + %> |
636 | + %endif |
637 | + %for k, v in categorias.items(): |
638 | + %if k==involn.product_id.categ_id.complete_name: |
639 | + <% |
640 | + t['cantidad']=v['cantidad']+involn.quantity |
641 | + t['subtotal']=v['subtotal']+subtotal |
642 | + existe=1 |
643 | + break |
644 | + %> |
645 | + %endif |
646 | + %endfor |
647 | + %if existe==0: |
648 | + <% |
649 | + t[involn.product_id.categ_id.complete_name]={'cantidad': involn.quantity,'subtotal':subtotal } |
650 | + categorias.update(t) |
651 | + %> |
652 | + %else: |
653 | + <% |
654 | + categorias[involn.product_id.categ_id.complete_name]=t |
655 | + %> |
656 | + %endif |
657 | + <% |
658 | + suma_total_cantidad=suma_total_cantidad+involn.quantity |
659 | + suma_total_subtotal=suma_total_subtotal+subtotal |
660 | + %> |
661 | +%endfor |
662 | + |
663 | +%for k, v in categorias.items(): |
664 | +<tr> |
665 | +<td style="border-bottom:1px solid;" >${k}</td> |
666 | +<td style="border-bottom:1px solid;float: right; text-align: right" >${formatLang(v['cantidad']) or 0.0}</td> |
667 | +<td colspan=2 style="border-bottom:1px solid;float: right; text-align: right" >${company.currency_id.symbol} ${formatLang(v['subtotal'],monetary=True) or 0.0}</td> |
668 | +</tr> |
669 | +%endfor |
670 | +<tr> |
671 | +<td style="border-bottom:1px solid;border-top:1px solid;" >Total:</td> |
672 | +<td style="border-bottom:1px solid;border-top:1px solid;float: right; text-align: right" >${formatLang(suma_total_cantidad) or 0.0}</td> |
673 | +<td colspan=2 style="border-bottom:1px solid;border-top:1px solid;float: right; text-align: right" >${company.currency_id.symbol} ${formatLang(suma_total_subtotal,monetary=True) or 0.0}</td> |
674 | +</tr> |
675 | +</table> |
676 | + |
677 | </body> |
678 | </html> |
679 | |
680 | === added file 'gbwinvoice_report_webkit/report/templates/gbwcategorydetail_report_webkit.mako' |
681 | --- gbwinvoice_report_webkit/report/templates/gbwcategorydetail_report_webkit.mako 1970-01-01 00:00:00 +0000 |
682 | +++ gbwinvoice_report_webkit/report/templates/gbwcategorydetail_report_webkit.mako 2013-06-04 21:36:25 +0000 |
683 | @@ -0,0 +1,122 @@ |
684 | +<html > |
685 | +<body> |
686 | + |
687 | +<% |
688 | +existe=0 |
689 | +categorias={} |
690 | +productos={} |
691 | +registros=0 |
692 | +suma_total_cantidad=0 |
693 | +suma_total_subtotal=0 |
694 | +subtotal=0 |
695 | +setLang(user.context_lang) |
696 | +%> |
697 | + |
698 | +<table style="align:right;" > |
699 | +<tr> |
700 | +<td style="font-size:small;" colspan=2>${data['form']['report_title'] or ''}</td> |
701 | +</tr> |
702 | +<tr> |
703 | +<td style="font-size:small;" >Del </td><td>${data['form']['from_date'] or '' }</td> |
704 | +<td style="font-size:small;" > al </td><td>${data['form']['to_date'] or '' }</td> |
705 | +</tr> |
706 | +</table> |
707 | + |
708 | + |
709 | +<table class="list_table" > |
710 | +<tr> |
711 | +<td style="border-bottom:2px solid;" >Categoria</td> |
712 | +<td style="border-bottom:2px solid;" >Producto</td> |
713 | +<td style="border-bottom:2px solid;" >Cantidad</td> |
714 | +<td style="border-bottom:2px solid;" >Importe</td> |
715 | +</tr> |
716 | +%for involn in objects: |
717 | + <% |
718 | + existec=0 |
719 | + existep=0 |
720 | + tc={} |
721 | + tp={} |
722 | + tp2={} |
723 | + productos={} |
724 | + %> |
725 | + %if involn.invoice_id.rate>0.0: |
726 | + <% |
727 | + subtotal=involn.price_subtotal*involn.invoice_id.rate |
728 | + %> |
729 | + %else: |
730 | + <% |
731 | + subtotal=involn.price_subtotal |
732 | + %> |
733 | + %endif |
734 | + %for k, v in categorias.items(): |
735 | + %if k==involn.product_id.categ_id.complete_name: |
736 | + <% |
737 | + existec=1 |
738 | + productos=v |
739 | + %> |
740 | + %for kp, vp in v.items(): |
741 | + %if kp==involn.product_id.name: |
742 | + <% |
743 | + tp2['referencia']=involn.product_id.code |
744 | + tp2['cantidad']=vp['cantidad']+involn.quantity |
745 | + tp2['subtotal']=vp['subtotal']+subtotal |
746 | + existep=1 |
747 | + break |
748 | + %> |
749 | + %endif |
750 | + %endfor |
751 | + %if existep==0: |
752 | + <% |
753 | + tp[involn.product_id.name]={'cantidad':involn.quantity,'subtotal':subtotal, 'referencia':involn.product_id.code } |
754 | + productos.update(tp) |
755 | + %> |
756 | + %else: |
757 | + <% |
758 | + tp[involn.product_id.name]=tp2 |
759 | + productos.update(tp) |
760 | + %> |
761 | + %endif |
762 | + <% |
763 | + break |
764 | + %> |
765 | + %endif |
766 | + %endfor |
767 | + %if existec==0: |
768 | + <% |
769 | + tp[involn.product_id.name]={'cantidad':involn.quantity,'subtotal':subtotal, 'referencia':involn.product_id.code } |
770 | + tc[involn.product_id.categ_id.complete_name]=tp |
771 | + categorias.update(tc) |
772 | + %> |
773 | + %else: |
774 | + <% |
775 | + tc[involn.product_id.categ_id.complete_name]=productos |
776 | + categorias.update(tc) |
777 | + %> |
778 | + %endif |
779 | + <% |
780 | + suma_total_cantidad=suma_total_cantidad+involn.quantity |
781 | + suma_total_subtotal=suma_total_subtotal+subtotal |
782 | + %> |
783 | +%endfor |
784 | + |
785 | +%for k, v in categorias.items(): |
786 | +<tr> |
787 | +<td colspan=4 style="border-bottom:1px solid;border-top:1px solid;" >${k}</td> |
788 | +</tr> |
789 | + %for kp, vp in v.items(): |
790 | + <tr> |
791 | + <td colspan=2 style="border-bottom:1px solid;font-size:small;" > [${vp['referencia']}] ${kp[0:15]}</td> |
792 | + <td style="border-bottom:1px solid;float: right; text-align: right;font-size:small;" >${formatLang(vp['cantidad']) or 0.0}</td> |
793 | + <td style="border-bottom:1px solid;float: right; text-align: right;font-size:small;" >${company.currency_id.symbol} ${formatLang(vp['subtotal'],monetary=True) or 0.0}</td> |
794 | + </tr> |
795 | + %endfor |
796 | +%endfor |
797 | +<tr> |
798 | +<td colspan=2 style="border-bottom:2px solid;border-top:2px solid;" >Total:</td> |
799 | +<td style="border-bottom:2px solid;border-top:2px solid;float: right; text-align: right" >${company.currency_id.symbol} ${formatLang(suma_total_cantidad) or 0.0}</td> |
800 | +<td style="border-bottom:2px solid;border-top:2px solid;float: right; text-align: right" >${company.currency_id.symbol} ${formatLang(suma_total_subtotal,monetary=True) or 0.0}</td> |
801 | +</tr> |
802 | +</table> |
803 | + |
804 | +</body> |
805 | +</html> |
806 | |
807 | === renamed file 'gbwinvoice_report_webkit/report/invoice_gbw_report.mako' => 'gbwinvoice_report_webkit/report/templates/gbwinvoice_report_webkit.mako' |
808 | --- gbwinvoice_report_webkit/report/invoice_gbw_report.mako 2013-05-27 18:43:36 +0000 |
809 | +++ gbwinvoice_report_webkit/report/templates/gbwinvoice_report_webkit.mako 2013-06-04 21:36:25 +0000 |
810 | @@ -1,16 +1,39 @@ |
811 | <html > |
812 | <body> |
813 | <% |
814 | - renglones = 0 |
815 | - total_importe = 0 |
816 | - total_iva= 0 |
817 | - total_total= 0 |
818 | - facturas = 0 |
819 | - facturas_reportadas = 0 |
820 | - facturas_borrador = 0 |
821 | - facturas_canceladas = 0 |
822 | - setLang(user.context_lang) |
823 | + renglones = 0 |
824 | + total_importe = 0 |
825 | + total_iva= 0 |
826 | + total_total= 0 |
827 | + facturas = 0 |
828 | + facturas_reportadas = 0 |
829 | + facturas_borrador = 0 |
830 | + facturas_canceladas = 0 |
831 | + setLang(user.context_lang) |
832 | + encabezado=True |
833 | + try: |
834 | + data['form'] |
835 | + except: |
836 | + encabezado=False |
837 | + pass |
838 | %> |
839 | +%if encabezado: |
840 | + <table style="align:right;" > |
841 | + <tr> |
842 | + <td style="font-size:small;" colspan=2>${data['form']['report_title'] or ''}</td> |
843 | + </tr> |
844 | + <tr> |
845 | + <td style="font-size:small;" >Del </td><td>${data['form']['from_date'] or '' }</td> |
846 | + <td style="font-size:small;" > al </td><td>${data['form']['to_date'] or '' }</td> |
847 | + </tr> |
848 | + </table> |
849 | +%else: |
850 | + <table style="align:right;" > |
851 | + <tr> |
852 | + <td style="font-size:small;" colspan=2>VENTAS FACTURADAS</td> |
853 | + </tr> |
854 | + </table> |
855 | +%endif |
856 | <table class="list_table" > |
857 | <tr> |
858 | <td style="border-bottom:2px solid;" >Fecha</td> |
859 | @@ -29,16 +52,16 @@ |
860 | <% renglones=0 %> |
861 | %endif |
862 | <tr> |
863 | -<td nowrap >${invo.date_invoice[0:11]} </td> |
864 | -<td nowrap >${invo.partner_id.ref} ${invo.partner_id.name[0:8] }</td> |
865 | -<td>${invo.number or '' }</td> |
866 | -<td>${invo.currency_id.name or '' }</td> |
867 | -<td><div style='float: right; text-align: right'>${"{:2.4f}".format(invo.rate)}</div></td> |
868 | -%if invo.state == 'cancel' : |
869 | -<td colspan=3 align=center >C A N C E L A D A</td> |
870 | +<td nowrap style="font-size:small;" >${time.strftime('%d-%m-%Y',time.strptime(invo.date_invoice,'%Y-%m-%d %H:%M:%S'))}</td> |
871 | +<td nowrap style="font-size:small;" >${invo.partner_id.ref} ${invo.partner_id.name[0:8] }</td> |
872 | +<td style="font-size:small;" >${invo.number or '' }</td> |
873 | +<td style="font-size:small;" >${invo.currency_id.name or '' }</td> |
874 | +<td><div style="float: right; text-align: right;font-size:small;">${"{:2.4f}".format(invo.rate)}</div></td> |
875 | +%if invo.state == 'cancel': |
876 | +<td colspan=3 align=center style="font-size:small;" >C A N C E L A D A</td> |
877 | <% facturas_canceladas= facturas_canceladas + 1 %> |
878 | -%elif invo.state == 'draft' : |
879 | -<td colspan=3 align=center >B O R R A D O R</td> |
880 | +%elif invo.state == 'draft': |
881 | +<td colspan=3 align=center style="font-size:small;">B O R R A D O R</td> |
882 | <% facturas_borrador= facturas_borrador + 1 %> |
883 | %else : |
884 | <% |
885 | @@ -51,9 +74,9 @@ |
886 | iva=iva*invo.rate |
887 | total=total*invo.rate |
888 | %> |
889 | -<td ><div style='float: right; text-align: right'>${formatLang(subtotal) or 0.0}</div></td> |
890 | -<td ><div style='float: right; text-align: right'>${formatLang(iva) or 0.0}</div></td> |
891 | -<td ><div style='float: right; text-align: right'>${formatLang(total) or 0.0 }</div></td> |
892 | +<td ><div style='float: right; text-align: right;font-size:small;'>${company.currency_id.symbol} ${formatLang(subtotal, monetary=True) or 0.0}</div></td> |
893 | +<td ><div style='float: right; text-align: right;font-size:small;'>${invo.currency_id.symbol} ${formatLang(iva, monetary=True) or 0.0}</div></td> |
894 | +<td ><div style='float: right; text-align: right;font-size:small;'>${invo.currency_id.symbol} ${formatLang(total, monetary=True) or 0.0 }</div></td> |
895 | <% |
896 | total_importe = total_importe + subtotal |
897 | total_iva= total_iva + iva |
898 | @@ -70,9 +93,9 @@ |
899 | <tr > |
900 | <td style="border-top:2px solid;border-bottom:2px solid;" >Total:</td> |
901 | <td colspan=4 style="border-top:2px solid;border-bottom:2px solid;" ></td> |
902 | -<td style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${formatLang(total_importe)}</div></td> |
903 | -<td style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${formatLang(total_iva)}</div></td> |
904 | -<td style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${formatLang(total_total)}</div></td> |
905 | +<td nowrap style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${invo.currency_id.symbol} ${formatLang(total_importe, monetary=True)}</div></td> |
906 | +<td nowrap style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${invo.currency_id.symbol} ${formatLang(total_iva, monetary=True)}</div></td> |
907 | +<td nowrap style="border-top:2px solid;border-bottom:2px solid;" ><div style='float: right; text-align: right'>${invo.currency_id.symbol} ${formatLang(total_total, monetary=True)}</div></td> |
908 | </tr> |
909 | </table> |
910 | <br><br> |
911 | |
912 | === added directory 'gbwinvoice_report_webkit/wizard' |
913 | === added file 'gbwinvoice_report_webkit/wizard/__init__.py' |
914 | --- gbwinvoice_report_webkit/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
915 | +++ gbwinvoice_report_webkit/wizard/__init__.py 2013-06-04 21:36:25 +0000 |
916 | @@ -0,0 +1,2 @@ |
917 | +import gbwinvoice_report_webkit_wizard |
918 | +import gbwcategory_report_webkit_wizard |
919 | |
920 | === added file 'gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard.py' |
921 | --- gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard.py 1970-01-01 00:00:00 +0000 |
922 | +++ gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard.py 2013-06-04 21:36:25 +0000 |
923 | @@ -0,0 +1,65 @@ |
924 | +# -*- coding: utf-8 -*- |
925 | +from osv import osv,fields |
926 | +from tools.translate import _ |
927 | +import time |
928 | +from datetime import datetime |
929 | + |
930 | +class gbwcategory_report_webkit_wizard(osv.osv_memory): |
931 | + _name = "gbwcategory.webkitwizard" |
932 | + _description = "GBW Invoices by Category" |
933 | + |
934 | + _columns = { |
935 | + 'from_date':fields.datetime('From'), |
936 | + 'to_date':fields.datetime('To'), |
937 | + 'report_title':fields.char('Report Title', size=128, required=False), |
938 | + 'detail_report': fields.boolean('Show Products Detail', help="Show products detail by category."), |
939 | + 'state': fields.selection([('choose','choose'), |
940 | + ('get','get'), |
941 | + ]), |
942 | + } |
943 | + |
944 | + def create_report(self, cr, uid, ids, context={}): |
945 | + data = self.read(cr,uid,ids,)[-1] |
946 | + invoice = self.pool.get('account.invoice') |
947 | + invoice_ids = invoice.search(cr, uid, [('date_invoice', '>', data['from_date']),('date_invoice', '<', data['to_date']),('state','!=','cancel'),('state','!=','draft')], context=context) |
948 | + |
949 | + invoice_line = self.pool.get('account.invoice.line') |
950 | + invoice_line_ids = invoice_line.search(cr, uid, [('invoice_id', 'in', invoice_ids)], order='product_id ASC',context=context) |
951 | + if data['detail_report']==True: |
952 | + data['report_title']='VENTAS FACTURADAS POR CATEGORIA DETALLE DE PRODUCTOS' |
953 | + res={ |
954 | + 'type' : 'ir.actions.report.xml', |
955 | + 'report_name' : 'gbwcategorydetail.report.webkit', |
956 | + 'datas': { |
957 | + 'model':'account.invoice.line', |
958 | + 'id': context.get('active_ids') and context.get('active_ids')[0] or False, |
959 | + 'ids': invoice_line_ids and invoice_line_ids or [], |
960 | + 'report_type': 'webkit', |
961 | + 'form': data |
962 | + }, |
963 | + 'nodestroy': False |
964 | + } |
965 | + else: |
966 | + res={ |
967 | + 'type' : 'ir.actions.report.xml', |
968 | + 'report_name' : 'gbwcategory.report.webkit', |
969 | + 'datas': { |
970 | + 'model':'account.invoice.line', |
971 | + 'id': context.get('active_ids') and context.get('active_ids')[0] or False, |
972 | + 'ids': invoice_line_ids and invoice_line_ids or [], |
973 | + 'report_type': 'webkit', |
974 | + 'form': data |
975 | + }, |
976 | + 'nodestroy': False |
977 | + } |
978 | + print data,' create_report(' |
979 | + |
980 | + return res |
981 | + |
982 | + _defaults = { |
983 | + 'detail_report': False, |
984 | + 'report_title': lambda *a: 'VENTAS FACTURADAS POR CATEGORIA', |
985 | + 'report_type': lambda *a: 'webkit', |
986 | + 'state': lambda *a: 'choose', |
987 | + } |
988 | +gbwcategory_report_webkit_wizard() |
989 | |
990 | === added file 'gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard_view.xml' |
991 | --- gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard_view.xml 1970-01-01 00:00:00 +0000 |
992 | +++ gbwinvoice_report_webkit/wizard/gbwcategory_report_webkit_wizard_view.xml 2013-06-04 21:36:25 +0000 |
993 | @@ -0,0 +1,46 @@ |
994 | +<?xml version="1.0"?> |
995 | +<openerp> |
996 | + <data > |
997 | +<!--====================Defining the wizard View==================--> |
998 | + |
999 | + <record id='gbwcategory_report_webkit_wizardform' model="ir.ui.view"> |
1000 | + <field name="name">GBW Invoices by Category</field> |
1001 | + <field name="model">gbwcategory.webkitwizard</field> |
1002 | + <field name="type">form</field> |
1003 | + <field name="arch" type="xml"> |
1004 | + <form string="Invoices" > |
1005 | + <group col="2" fill="0" height="500" states="choose"> |
1006 | + <separator string="Filter" colspan="4"/> |
1007 | + <field name="from_date" required='1'/> |
1008 | + <field name="to_date" required='1' /> |
1009 | + <field name="detail_report" /> |
1010 | + <field name="report_title" invisible="1" /> |
1011 | + <separator colspan="2"/> |
1012 | + <group colspan="2"> |
1013 | + <button special="cancel" icon="gtk-cancel" string="Cancel"/> |
1014 | + <button type="object" name="create_report" icon="gtk-go-forward" string="Create"/> |
1015 | + </group> |
1016 | + <field invisible="1" name="state"/> |
1017 | + </group> |
1018 | + </form> |
1019 | + </field> |
1020 | + </record> |
1021 | + |
1022 | + <record model="ir.actions.act_window" id="action_gbwcategory_report_webkit"> |
1023 | + <field name="name">GBW Invoice Report by Category</field> |
1024 | + <field name="res_model">gbwcategory.webkitwizard</field> |
1025 | + <field name="view_type">form</field> |
1026 | + <field name="view_mode">form</field> |
1027 | + <field name="target">new</field> |
1028 | + </record> |
1029 | +<!--====================Specifying the report menu ========================--> |
1030 | + |
1031 | + <menuitem id="gbwcategory_report_webkit" name="GBW Invoices by Category" |
1032 | + action="action_gbwcategory_report_webkit" |
1033 | + parent="account.menu_finance_statistic_report_statement" |
1034 | + sequence="25" |
1035 | + /> |
1036 | + |
1037 | + </data> |
1038 | +</openerp> |
1039 | + |
1040 | |
1041 | === added file 'gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.py' |
1042 | --- gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.py 1970-01-01 00:00:00 +0000 |
1043 | +++ gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.py 2013-06-04 21:36:25 +0000 |
1044 | @@ -0,0 +1,45 @@ |
1045 | +# -*- coding: utf-8 -*- |
1046 | +from osv import osv,fields |
1047 | +from tools.translate import _ |
1048 | +import time |
1049 | +from datetime import datetime |
1050 | + |
1051 | +class gbwinvoice_report_webkit_wizard(osv.osv_memory): |
1052 | + _name = "gbwinvoice.webkitwizard" |
1053 | + _description = "GBW Invoices by Period" |
1054 | + |
1055 | + _columns = { |
1056 | + 'from_date':fields.datetime('From'), |
1057 | + 'to_date':fields.datetime('To'), |
1058 | + 'report_title':fields.char('Report Title', size=128, required=False), |
1059 | + 'state': fields.selection([('choose','choose'), |
1060 | + ('get','get'), |
1061 | + ]), |
1062 | + |
1063 | + } |
1064 | + |
1065 | + def create_report(self, cr, uid, ids, context={}): |
1066 | + data = self.read(cr,uid,ids,)[-1] |
1067 | + invoice = self.pool.get('account.invoice') |
1068 | + invoice_ids = invoice.search(cr, uid, [('date_invoice', '>', data['from_date']),('date_invoice', '<', data['to_date'])], order='number ASC, date_invoice ASC',context=context) |
1069 | + print data,' create_report(' |
1070 | + |
1071 | + return { |
1072 | + 'type' : 'ir.actions.report.xml', |
1073 | + 'report_name' : 'gbwinvoice.report.webkit', |
1074 | + 'datas': { |
1075 | + 'model':'account.invoice', |
1076 | + 'id': context.get('active_ids') and context.get('active_ids')[0] or False, |
1077 | + 'ids': invoice_ids and invoice_ids or [], |
1078 | + 'report_type': 'webkit', |
1079 | + 'form': data |
1080 | + }, |
1081 | + 'nodestroy': False |
1082 | + } |
1083 | + |
1084 | + _defaults = { |
1085 | + 'report_title': lambda *a: 'VENTAS FACTURADAS', |
1086 | + 'report_type': lambda *a: 'webkit', |
1087 | + 'state': lambda *a: 'choose', |
1088 | + } |
1089 | +gbwinvoice_report_webkit_wizard() |
1090 | |
1091 | === added file 'gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.xml' |
1092 | --- gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.xml 1970-01-01 00:00:00 +0000 |
1093 | +++ gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard.xml 2013-06-04 21:36:25 +0000 |
1094 | @@ -0,0 +1,9 @@ |
1095 | +<?xml version="1.0"?> |
1096 | +<openerp> |
1097 | + <data> |
1098 | + <wizard string="Print GBW Invoices by Period" model="account.invoice" |
1099 | + name="account.gbwinvoiceswiz" /> |
1100 | + <wizard string="Print GBW Invoices by Product Categories" model="account.invoice.line" |
1101 | + name="account.gbwinvoiceswiz" /> |
1102 | + </data> |
1103 | +</openerp> |
1104 | |
1105 | === added file 'gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard_view.xml' |
1106 | --- gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard_view.xml 1970-01-01 00:00:00 +0000 |
1107 | +++ gbwinvoice_report_webkit/wizard/gbwinvoice_report_webkit_wizard_view.xml 2013-06-04 21:36:25 +0000 |
1108 | @@ -0,0 +1,45 @@ |
1109 | +<?xml version="1.0"?> |
1110 | +<openerp> |
1111 | + <data > |
1112 | +<!--====================Defining the wizard View==================--> |
1113 | + |
1114 | + <record id='gbwinvoice_report_webkit_wizardform' model="ir.ui.view"> |
1115 | + <field name="name">GBW Invoice Report by Period</field> |
1116 | + <field name="model">gbwinvoice.webkitwizard</field> |
1117 | + <field name="type">form</field> |
1118 | + <field name="arch" type="xml"> |
1119 | + <form string="Invoices" > |
1120 | + <group col="2" fill="0" height="500" states="choose"> |
1121 | + <separator string="Filter" colspan="4"/> |
1122 | + <field name="from_date" required='1'/> |
1123 | + <field name="to_date" required='1' /> |
1124 | + <field name="report_title" invisible="1" /> |
1125 | + <separator colspan="2"/> |
1126 | + <group colspan="2"> |
1127 | + <button special="cancel" icon="gtk-cancel" string="Cancel"/> |
1128 | + <button type="object" name="create_report" icon="gtk-go-forward" string="Create"/> |
1129 | + </group> |
1130 | + <field invisible="1" name="state"/> |
1131 | + </group> |
1132 | + </form> |
1133 | + </field> |
1134 | + </record> |
1135 | + |
1136 | + <record model="ir.actions.act_window" id="action_gbwinvoice_report_webkit"> |
1137 | + <field name="name">GBW Invoice Report by Period</field> |
1138 | + <field name="res_model">gbwinvoice.webkitwizard</field> |
1139 | + <field name="view_type">form</field> |
1140 | + <field name="view_mode">form</field> |
1141 | + <field name="target">new</field> |
1142 | + </record> |
1143 | +<!--====================Specifying the report menu ========================--> |
1144 | + |
1145 | + <menuitem id="gbwinvoice_report_webkit" name="GBW Invoice Report by Period" |
1146 | + action="action_gbwinvoice_report_webkit" |
1147 | + parent="account.menu_finance_statistic_report_statement" |
1148 | + sequence="24" |
1149 | + /> |
1150 | + |
1151 | + </data> |
1152 | +</openerp> |
1153 | + |