Merge lp:~vauxoo/addons-vauxoo/7.0_report_for_user_stories_added_dev_Sergio into lp:addons-vauxoo/7.0

Status: Merged
Approved by: Jorge Angel Naranjo Rogel - http://www.vauxoo.com
Approved revision: 1093
Merged at revision: 1109
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0_report_for_user_stories_added_dev_Sergio
Merge into: lp:addons-vauxoo/7.0
Diff against target: 716 lines (+555/-10)
9 files modified
user_story/__openerp__.py (+4/-5)
user_story/data/data_us_report.xml (+378/-0)
user_story/i18n/es.po (+18/-0)
user_story/i18n/user_story.pot (+4/-1)
user_story/report/__init__.py (+2/-1)
user_story/report/parse_report.py (+8/-3)
user_story/report/user_story_report.mako (+59/-0)
user_story/report/user_story_report_mako.py (+61/-0)
user_story/report/user_story_report_view.xml (+21/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0_report_for_user_stories_added_dev_Sergio
Reviewer Review Type Date Requested Status
Jorge Angel Naranjo Rogel - http://www.vauxoo.com Needs Fixing
Juan Carlos Hernandez Needs Resubmitting
Luis Ernesto García Medina - http://www.vauxoo.com Pending
Review via email: mp+226500@code.launchpad.net

Description of the change

Se agrego al módulo user_story los archivos necesarios y las modificaciones a código contenido en el mismo para generar reportes de historias de usuario, utilizando la herramienta WEBKIT.

To post a comment you must log in.
1076. By Sergio Ernesto Tostado Sánchez - http://www.vauxoo.com

[ADD][user_story] The report_webkit module was added like a dependency for this module

1077. By Sergio Ernesto Tostado Sánchez - http://www.vauxoo.com

[REF][user_story] I overwrote the depends list in the __openerp__.py file to add the report_webkit dependency

1078. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][user_story] is added to the description of the module, the command to install python-html2text to print reports

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote :

@Sergio @Wicho

Pueden realizar las correcciones al reporte.

review: Needs Fixing
1079. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][user_story] change indentation on files for white space, change background color of tables.

1080. By Luis Ernesto García Medina - http://www.vauxoo.com

[MERGE] merge with lp:addons-vauxoo/7.0

1081. By Juan Carlos Hernandez

[IMP][user_story]improve report user story

1082. By Juan Carlos Hernandez

[IMP][user_story]improve print

Revision history for this message
Juan Carlos Hernandez (openerp1) wrote :

@Jorge
Podrias checar la tarea, ya quedó bien la impresión del campo descripción

review: Needs Resubmitting
1083. By Juan Carlos Hernandez

[IMP][user_story]change size title

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote :

@Carlos

Puedes revisar el comentario que te hice

review: Needs Fixing
1084. By Juan Carlos Hernandez

[IMP][user_story]validation for string empty

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote :

@Carlos

Hacen falta agregar las traducciones del reporte

review: Needs Fixing
Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote :

@Carlos

Puedes revisar los conflictos que marca

review: Needs Fixing
Revision history for this message
Juan Carlos Hernandez (openerp1) wrote :

@Jorge
Ya resolví los conflictos de traducción

review: Needs Resubmitting
1085. By Juan Carlos Hernandez

[IMP][user_story]validation for string empty and add setLang to report

1086. By Juan Carlos Hernandez

[IMP][user_story]improve traslation for roseta

1087. By Juan Carlos Hernandez

[IMP][user_story]improve code

1088. By Juan Carlos Hernandez

[IMP][user_story]improve traslation

1089. By Juan Carlos Hernandez

[IMP][user_story]traslation title of report

1090. By Juan Carlos Hernandez

[IMP][user_story]add traslation for planned hours

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) :
review: Needs Fixing
1091. By Juan Carlos Hernandez

[REF][user_story]deprecated ir_report.xml ofr report sxw

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) :
review: Needs Fixing
1092. By Juan Carlos Hernandez

[FIX][user_story]delete library html2text

Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) :
review: Needs Fixing
1093. By Juan Carlos Hernandez

[FIX][user_story]fix copyrigth

1094. By Juan Carlos Hernandez

[MERGE]merge with lp:addons-vauxoo/7.0 because there was a error in test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'user_story/__openerp__.py'
--- user_story/__openerp__.py 2014-07-25 06:11:04 +0000
+++ user_story/__openerp__.py 2014-08-12 14:42:57 +0000
@@ -33,6 +33,7 @@
33 "sprint_kanban",33 "sprint_kanban",
34 "project_timesheet",34 "project_timesheet",
35 "project_conf",35 "project_conf",
36 "report_webkit",
36 ],37 ],
37 "author" : "Vauxoo",38 "author" : "Vauxoo",
38 "description" : """39 "description" : """
@@ -47,22 +48,20 @@
47siguientes:48siguientes:
4849
49.. Story: http://dannorth.net/whats-in-a-story/50.. Story: http://dannorth.net/whats-in-a-story/
50.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/51.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""",
51 """,
52 "website" : "http://vauxoo.com",52 "website" : "http://vauxoo.com",
53 "category" : "Generic Modules",53 "category" : "Generic Modules",
54 "demo" : [54 "demo" : [
55 'demo/demo.xml',55 'demo/demo.xml',
56 ],56 ],
57 "data" : [57 "data" : [
58 "report/ir_report.xml",58 "data/data_us_report.xml",
59 "report/user_story_report_view.xml",
59 "security/userstory_security.xml",60 "security/userstory_security.xml",
60 "security/ir.model.access.csv",61 "security/ir.model.access.csv",
61 "view/userstory_view.xml",62 "view/userstory_view.xml",
62 "view/project_view.xml",63 "view/project_view.xml",
63 "view/hr_timesheet_view.xml",64 "view/hr_timesheet_view.xml",
64 "view/hr_timesheet_all_view.xml",
65 "view/custom_project_task_view.xml",
66 "data/data.xml",65 "data/data.xml",
67 "data/user_story_template.xml",66 "data/user_story_template.xml",
68 ],67 ],
6968
=== added file 'user_story/data/data_us_report.xml'
--- user_story/data/data_us_report.xml 1970-01-01 00:00:00 +0000
+++ user_story/data/data_us_report.xml 2014-08-12 14:42:57 +0000
@@ -0,0 +1,378 @@
1<?xml version="1.0" ?>
2<openerp>
3 <data noupdate="0">
4 <record id="ir_header_webkit_user_story_report" model="ir.header_webkit">
5 <field name="footer_html"><![CDATA[<!DOCTYPE>
6 <html>
7 <head>
8 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
9 <script>
10 function subst() {
11 var vars={};
12 var x=document.location.search.substring(1).split('&');
13 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
14 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
15 for(var i in x) {
16 var y = document.getElementsByClassName(x[i]);
17 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
18 }
19 }
20 </script>
21 </head>
22 <body style="border:0; margin: 0;" onload="subst()">
23 <table style="border-top: 1px solid black; width: 100%">
24 <tr >
25 <td style="text-align:left;font-size:7;" width="50%">Generado con software libre en OpenERP y Webkit por http://www.vauxoo.com</td>
26 <td style="text-align:right;font-size:11;" width="45%">Page <span class="page"/></td><td style="text-align:left;font-size:11;" width="5%"> of <span class="topage"/></td>
27 </tr>
28 </table>
29 </body>
30 </html>]]>
31 </field>
32 <field name="orientation">Portrait</field>
33 <field name="format">Letter</field>
34 <field name="html"><![CDATA[<!DOCTYPE>
35 <html>
36 <head>
37 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
38 <script>
39 function subst() {
40 var vars={};
41 var x=document.location.search.substring(1).split('&');
42 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
43 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
44 for(var i in x) {
45 var y = document.getElementsByClassName(x[i]);
46 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
47 }
48 }
49 </script>
50 <style type="text/css">
51 ${css}
52 </style>
53 </head>
54 <body style="border:0; margin: 0;" onload="subst()">
55 ${_debug or ''|n} </body>
56 </html>]]>
57 </field>
58 <field eval="0.0" name="margin_top"/>
59 <field name="css" ><![CDATA[
60.table_all_border {
61 border-collapse: collapse;
62 width: 100%;
63 border: 1px solid #f2f2f2; }
64 .table_all_border > thead > tr > th,
65 .table_all_border > thead > tr > td,
66 .table_all_border > tbody > tr > th,
67 .table_all_border > tbody > tr > td,
68 .table_all_border > tfoot > tr > th,
69 .table_all_border > tfoot > tr > td {
70 border: 1px solid #f2f2f2; }
71 .table_all_border > thead > tr > th,
72 .table_all_border > thead > tr > td {
73 border-bottom-width: 1px solid #f2f2f2; }
74
75.table_title_bg_color {
76 border-collapse: collapse; }
77 .table_title_bg_color > thead > tr > th,
78 .table_title_bg_color > tbody > tr > th,
79 .table_title_bg_color > tfoot > tr > th {
80 border-bottom: 1px solid #f2f2f2;
81 border-top: 1px solid #f2f2f2;
82 background-color: #A41D35;
83 font-size: 7;
84 color: white; }
85
86.table_title {
87 border-collapse: collapse;
88 width: 100%; }
89 .table_title > thead > tr > th,
90 .table_title > tbody > tr > th,
91 .table_title > tfoot > tr > th {
92 border-bottom: 2px solid #f2f2f2;
93 font-size: 7;
94 color: white; }
95
96.table_row_border {
97 border-collapse: collapse;
98 width: 100%; }
99 .table_row_border > thead > tr > th,
100 .table_row_border > thead > tr > td,
101 .table_row_border > tbody > tr > th,
102 .table_row_border > tbody > tr > td,
103 .table_row_border > tfoot > tr > th,
104 .table_row_border > tfoot > tr > td {
105 border-bottom: 1px solid #f2f2f2; }
106 .table_row_border > thead > tr > th,
107 .table_row_border > thead > tr > td {
108 border-bottom-width: 1px; }
109
110.table_column_border {
111 border-collapse: collapse;
112 }
113 .table_column_border > thead > tr > td,
114 .table_column_border > tbody > tr > td,
115 .table_column_border > tfoot > tr > td {
116 border: 1px solid #f2f2f2;
117 border-width: 0 1px; }
118 .table_column_border > thead > tr > td:first-child, .table_column_border > thead > tr td + td,
119 .table_column_border > tbody > tr > td:first-child,
120 .table_column_border > tbody > tr td + td,
121 .table_column_border > tfoot > tr > td:first-child,
122 .table_column_border > tfoot > tr td + td {
123 border-left: 0; }
124 .table_column_border > thead > tr > td:last-child,
125 .table_column_border > tbody > tr > td:last-child,
126 .table_column_border > tfoot > tr > td:last-child {
127 padding-right: 0;
128 border-right: 0; }
129
130.table_alter_color_row {
131 border-collapse: collapse; }
132 .table_alter_color_row > tbody > tr:nth-child(2n+1) > td {
133 background-color: gainsboro ; }
134 .table_alter_color_row > tbody > tr:nth-child(2n+2) > td {
135 background-color: whitesmoke; }
136
137.table_alter_color_column {
138 border-collapse: collapse;
139 width: 100%; }
140 .table_alter_color_column > tbody
141 > tr
142 > td:nth-child(2n+1) {
143 background-color: gainsboro; }
144 .table_alter_color_column > tbody
145 > tr
146 > td:nth-child(2n+2) {
147 background-color: whitesmoke; }
148
149.table_only_border_top {
150 border-collapse: collapse;
151 width: 100%; }
152 .table_only_border_top > tbody
153 > tr {
154 border-top: 1px solid #f2f2f2; }
155
156.table_only_border_bottom {
157 border-collapse: collapse;
158 width: 100%; }
159 .table_only_border_bottom > tbody
160 > tr {
161 border-bottom: 1px solid #f2f2f2; }
162
163.panel {
164 padding: 8px 8px;
165 background-color: #5bc0de; }
166
167.panel_radius_color {
168 border: 2px solid #ee8f9e;
169 border-radius: 15px;
170 padding: 8px 8px; }
171
172.panel_radius_trans {
173 border: 2px solid transparent;
174 border-radius: 15px;
175 padding: 8px 8px; }
176
177.panel_bg_color {
178 padding: 5px 5px;
179 background: #f2f2f2;
180 font-size: 6pt; }
181
182.panel_bg_color_title {
183 padding: 5px 5px;
184 background: #A41D35;
185 color: white;
186 font-size: 6pt;
187 font-family: "Helvetica Neue", Helvetica, Arial, sans_serif; }
188
189.panel_box_shadow {
190 box-shadow: 5px 5px 10px #222222; }
191
192.panel_bg_color_gradient {
193 background: -webkit-linear-gradient(#333333, gainsboro);
194 /* For Safari */
195 background: -o-linear-gradient(#333333, gainsboro);
196 /* For Opera 11.1 to 12.0 */
197 background: -moz-linear-gradient(#333333, gainsboro);
198 /* For Firefox 3.6 to 15 */
199 background: linear-gradient(#333333, gainsboro);
200 /* Standard syntax (must be last) */ }
201
202.panel_border_radius_top {
203 border-top-right-radius: 15px;
204 border-top-left-radius: 15px;
205 border: 2px solid #ee8f9e;
206 padding: 5px; }
207
208.panel_radius_top {
209 border-top-right-radius: 15px;
210 border-top-left-radius: 15px;
211 padding: 5px; }
212
213.panel_border_radius_top_right {
214 border-top-right-radius: 15px;
215 border: 2px solid #ee8f9e;
216 padding: 5px; }
217
218.panel_border_radius_top_left {
219 border-top-left-radius: 15px;
220 border: 2px solid #ee8f9e;
221 padding: 5px; }
222
223.panel_border_radius_bottom {
224 border-bottom-right-radius: 15px;
225 border-bottom-left-radius: 15px;
226 border: 2px solid #ee8f9e;
227 padding: 5px; }
228
229.panel_radius_bottom {
230 border-bottom-right-radius: 15px;
231 border-bottom-left-radius: 15px;
232 padding: 5px; }
233
234.panel_border_radius_bottom_right {
235 border-bottom-right-radius: 15px;
236 border: 2px solid #ee8f9e;
237 padding: 5px; }
238
239.panel_border_radius_bottom_left {
240 border-bottom-left-radius: 15px;
241 border: 2px solid #ee8f9e;
242 padding: 5px; }
243
244body {
245 color: black;
246 font-family: "Helvetica Neue", Helvetica, Arial, sans_serif;
247 font-size: 7;
248 margin: 0;
249 padding: 0;
250 height: 100%;
251 line-height: 12px; }
252
253table.basic_table {
254 border-collapse: collapse;
255 width: 100%; }
256
257.imagen_company {
258 vertical-align: top;
259 width: 35%; }
260
261.data_emitter {
262 vertical-align: top;
263 color: black;
264 text-align: right;
265 font-size: 7; }
266
267.data_customer {
268 vertical-align: top;
269 color: black;
270 text-align: left;
271 font-size: 7; }
272
273th {
274 padding-right: 2px;
275 padding-left: 2px;
276 text-align: center;
277 font-size: 7; }
278
279strong{
280 font-size: 18;
281 font-weight: bold;
282}
283
284.data_company{
285 font-size: 10;
286}
287
288
289pre {
290 font-size: 12pt;
291 font-family: helvetica;
292 white-space: pre-wrap;
293 white-space: -moz-pre-wrap !important;
294 white-space: -pre-wrap;
295 white-space: -o-pre-wrap;
296 word-wrap: break-word; }
297
298
299.pre_description {
300 font-size: 6pt;
301 font-family: helvetica;
302 white-space: pre-wrap;
303 white-space: -moz-pre-wrap !important;
304 white-space: -pre-wrap;
305 white-space: -o-pre-wrap;
306 word-wrap: break-word;
307 background: #f2f2f2; }
308
309hr{
310 width:95%;
311 color:lightgrey;
312}
313
314td{
315 font-size:7;
316}
317
318.td_without_bottom{
319 border-bottom: 1px solid #FFFFFF;
320}
321
322.td_amount{
323 text-align:right
324}
325
326.td_center {
327text-align: center; }
328
329.th_center {
330text-align: center; }
331
332.td_bold {
333font-weight: bold; }
334
335.th_widht {
336 width: 33%; }
337
338.td_condiciones{
339 font-size:6;
340}
341
342table.fixed {
343table-layout:fixed;
344width:33%;
345word-break:break-all;
346}
347
348td.total_td {
349border-top: solid 1.5px #A41D35;
350font-size: 8;
351padding-right: 2px;
352padding-left: 2px;
353font-weight: bold;
354color: black; }
355
356td.sub_total_td {
357border-top: solid 1.5px #A41D35;
358font-size: 8;
359padding-right: 2px;
360padding-left: 2px;
361color: black; }
362
363
364.td_vertical_middle {
365 vertical-align: middle; }
366p.td_margin_botton {
367margin-bottom:20px;
368}
369
370]]> </field>
371 <field name="name">User Story Report Vauxoo Webkit</field>
372 </record>
373 <record id="ir_header_img_companylogo0" model="ir.header_img">
374 <field eval="&quot;&quot;&quot;jpg&quot;&quot;&quot;" name="type"/>
375 <field eval="&quot;&quot;&quot;company_logo&quot;&quot;&quot;" name="name"/>
376 </record>
377 </data>
378</openerp>
0379
=== modified file 'user_story/i18n/es.po'
--- user_story/i18n/es.po 2014-08-09 05:43:24 +0000
+++ user_story/i18n/es.po 2014-08-12 14:42:57 +0000
@@ -110,6 +110,7 @@
110#. module: user_story110#. module: user_story
111#: field:acceptability.criteria,scenario:0111#: field:acceptability.criteria,scenario:0
112#: view:user.story:0112#: view:user.story:0
113#: report:addons/user_story/report/user_story_report.mako:47
113msgid "Scenario"114msgid "Scenario"
114msgstr "Escenario"115msgstr "Escenario"
115116
@@ -190,6 +191,7 @@
190#. module: user_story191#. module: user_story
191#: view:project.task:0192#: view:project.task:0
192#: field:user.story,planned_hours:0193#: field:user.story,planned_hours:0
194#: report:addons/user_story/report/user_story_report.mako:26
193msgid "Planned Hours"195msgid "Planned Hours"
194msgstr "Horas Estimadas"196msgstr "Horas Estimadas"
195197
@@ -352,6 +354,7 @@
352#. module: user_story354#. module: user_story
353#: view:user.story:0355#: view:user.story:0
354#: field:user.story,owner:0356#: field:user.story,owner:0
357#: report:addons/user_story/report/user_story_report.mako:22
355msgid "Owner"358msgid "Owner"
356msgstr "Dueño"359msgstr "Dueño"
357360
@@ -416,6 +419,7 @@
416#: view:project.task:0419#: view:project.task:0
417#: field:project.task,userstory_id:0420#: field:project.task,userstory_id:0
418#: view:user.story:0421#: view:user.story:0
422#: report:addons/user_story/report/user_story_report.mako:10
419msgid "User Story"423msgid "User Story"
420msgstr "Historia de Usuario"424msgstr "Historia de Usuario"
421425
@@ -616,6 +620,7 @@
616#: view:project.project:0620#: view:project.project:0
617#: field:project.project,descriptions:0621#: field:project.project,descriptions:0
618#: field:user.story,description:0622#: field:user.story,description:0
623#: report:addons/user_story/report/user_story_report.mako:33
619msgid "Description"624msgid "Description"
620msgstr "Descripción"625msgstr "Descripción"
621626
@@ -670,6 +675,7 @@
670675
671#. module: user_story676#. module: user_story
672#: field:user.story.priority,name:0677#: field:user.story.priority,name:0
678#: report:addons/user_story/report/user_story_report.mako:46
673msgid "Name"679msgid "Name"
674msgstr "Nombre"680msgstr "Nombre"
675681
@@ -680,6 +686,7 @@
680686
681#. module: user_story687#. module: user_story
682#: view:acceptability.criteria:0688#: view:acceptability.criteria:0
689#: report:addons/user_story/report/user_story_report.mako:41
683msgid "Acceptability Criterion"690msgid "Acceptability Criterion"
684msgstr "Criterio de Aceptación"691msgstr "Criterio de Aceptación"
685692
@@ -738,3 +745,14 @@
738#: view:user.story:0745#: view:user.story:0
739msgid "Sprint"746msgid "Sprint"
740msgstr "Sprint"747msgstr "Sprint"
748
749#. module: user_story
750#: view:user.story:0
751#: report:addons/user_story/report/user_story_report.mako:18
752msgid "Related Project"
753msgstr "Proyecto Relacionado"
754
755#. module: user_story
756#: model:ir.actions.report.xml,name:user_story.user_story_report_webkit
757msgid "User Story Report"
758msgstr "Reporte de Historia de Usuario"
741\ No newline at end of file759\ No newline at end of file
742760
=== modified file 'user_story/i18n/user_story.pot'
--- user_story/i18n/user_story.pot 2014-05-09 21:51:34 +0000
+++ user_story/i18n/user_story.pot 2014-08-12 14:42:57 +0000
@@ -104,6 +104,7 @@
104104
105#. module: user_story105#. module: user_story
106#: field:acceptability.criteria,scenario:0106#: field:acceptability.criteria,scenario:0
107#: report:addons/user_story/report/user_story_report.mako:47
107#: view:user.story:0108#: view:user.story:0
108msgid "Scenario"109msgid "Scenario"
109msgstr ""110msgstr ""
@@ -514,6 +515,8 @@
514msgid "sc 1.2"515msgid "sc 1.2"
515msgstr ""516msgstr ""
516517
518
519
517#. module: user_story520#. module: user_story
518#: model:acceptability.criteria,scenario:user_story.ac_11521#: model:acceptability.criteria,scenario:user_story.ac_11
519msgid "sc 1.1"522msgid "sc 1.1"
@@ -608,6 +611,7 @@
608611
609#. module: user_story612#. module: user_story
610#: field:user.story.priority,name:0613#: field:user.story.priority,name:0
614#: report:addons/user_story/report/user_story_report.mako:46
611msgid "Name"615msgid "Name"
612msgstr ""616msgstr ""
613617
@@ -674,4 +678,3 @@
674#: view:user.story:0678#: view:user.story:0
675msgid "Sprint"679msgid "Sprint"
676msgstr ""680msgstr ""
677
678681
=== modified file 'user_story/report/__init__.py'
--- user_story/report/__init__.py 2014-05-31 22:07:48 +0000
+++ user_story/report/__init__.py 2014-08-12 14:42:57 +0000
@@ -1,1 +1,2 @@
1import parse_report1#~ import parse_report
2import user_story_report_mako
23
=== modified file 'user_story/report/parse_report.py'
--- user_story/report/parse_report.py 2014-08-02 05:34:10 +0000
+++ user_story/report/parse_report.py 2014-08-12 14:42:57 +0000
@@ -36,9 +36,14 @@
36 self.context = context36 self.context = context
3737
38 def _parse_html_field(self, data):38 def _parse_html_field(self, data):
39 tree = html.fromstring(data)39 if data:
40 text_data = tree.text_content()40 data_str = data.encode('ascii', 'xmlcharrefreplace')
41 return text_data41 data_str = data_str.replace('<br>', '\n')
42 root = html.fromstring(data_str)
43 text_data = html.tostring(root, encoding='unicode', method='text')
44 text_data = text_data.encode('ascii', 'xmlcharrefreplace')
45 return text_data
46 return ''
4247
43report_sxw.report_sxw('report.user.story.report',48report_sxw.report_sxw('report.user.story.report',
44 'user.story',49 'user.story',
4550
=== added file 'user_story/report/user_story_report.mako'
--- user_story/report/user_story_report.mako 1970-01-01 00:00:00 +0000
+++ user_story/report/user_story_report.mako 2014-08-12 14:42:57 +0000
@@ -0,0 +1,59 @@
1<html>
2 <head>
3 <style type="text/css">${css}</style>
4 </head>
5 <body>
6 <% setLang(user.lang) %>
7 % for user.story in objects:
8 <table width="100%">
9 <tr>
10 <th class="panel_bg_color_title">${_("User Story")}</th>
11 </tr>
12 <tr>
13 <td class="td_center"><h5><p class="td_margin">${user and user.story and user.story.name}</p></h5></td>
14 </tr>
15 </table>
16 <table width="100%">
17 <tr>
18 <th class="th_center panel_bg_color_title">${_("Related Project")}</th>
19 <td class="panel_bg_color">${user and user.story and user.story.project_id and user.story.project_id.name}</td>
20 </tr>
21 <tr>
22 <th class="th_center panel_bg_color_title">${_("Owner")}</th>
23 <td class="panel_bg_color">${user and user.story and user.story.owner_id and user.story.owner_id.name}</td>
24 </tr>
25 <tr>
26 <th class="th_center panel_bg_color_title">${_("Planned Hours")}</th>
27 <td class="panel_bg_color">${user and user.story and user.story.planned_hours}</td>
28 </tr>
29 </table>
30 <p class="td_margin"></br></p>
31 <table width="100%">
32 <tr>
33 <th class="panel_bg_color_title">${_("Description")}</th>
34 </tr>
35 <tr>
36 <td class="pre_description">${parse_html_field(user.story.description)}</td>
37 </tr>
38 </table>
39 <table width="100%">
40 <tr>
41 <th class="panel_bg_color_title">${_("Acceptability Criterion")}</th>
42 </tr>
43 </table>
44 <table width="100%">
45 <tr>
46 <th class="th_center panel_bg_color_title">${_("Name")}</th>
47 <th class="th_center panel_bg_color_title">${_("Scenario")}</th>
48 </tr>
49 % for criteria in (user and user.story and user.story.accep_crit_ids):
50 <tr>
51 <td class="panel_bg_color">${criteria.name}</td>
52 <td class="panel_bg_color">${criteria.scenario}</td>
53 </tr>
54 % endfor
55 </table>
56 <p style="page-break-before: always;"></p>
57 % endfor
58 </body>
59</html>
060
=== added file 'user_story/report/user_story_report_mako.py'
--- user_story/report/user_story_report_mako.py 1970-01-01 00:00:00 +0000
+++ user_story/report/user_story_report_mako.py 2014-08-12 14:42:57 +0000
@@ -0,0 +1,61 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3#
4# Module Writen to OpenERP, Open Source Management Solution
5#
6# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
7# All Rights Reserved.
8# info Vauxoo (info@vauxoo.com)
9#
10# Coded by: vauxoo consultores (info@vauxoo.com)
11#
12#
13# This program is free software: you can redistribute it and/or modify
14# it under the terms of the GNU Affero General Public License as
15# published by the Free Software Foundation, either version 3 of the
16# License, or (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU Affero General Public License for more details.
22#
23# You should have received a copy of the GNU Affero General Public License
24# along with this program. If not, see <http://www.gnu.org/licenses/>.
25#
26
27from openerp.osv import fields, osv
28from openerp.tools.translate import _
29from report_webkit import webkit_report
30from report import report_sxw
31from lxml import html
32import xml
33
34class user_story_report(report_sxw.rml_parse):
35
36 def __init__(self, cr, uid, name, context=None):
37 if context is None:
38 context = {}
39 super(user_story_report, self).__init__(
40 cr, uid, name, context=context)
41 self.localcontext.update({
42 'parse_html_field' : self._parse_html_field,
43 })
44 self.context = context
45
46 def _parse_html_field(self, data):
47 if data:
48 data_str = data.encode('ascii', 'xmlcharrefreplace')
49 data_str = data_str.replace('<br>', '\n')
50 root = html.fromstring(data_str)
51 text_data = html.tostring(root, encoding='unicode', method='text')
52 text_data = text_data.encode('ascii', 'xmlcharrefreplace')
53 return text_data
54 return ''
55
56webkit_report.WebKitParser('report.user.story.report',
57 'user.story',
58 'addons/user_story/report/user_story_report.mako',
59 parser=user_story_report)
60
61# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
062
=== added file 'user_story/report/user_story_report_view.xml'
--- user_story/report/user_story_report_view.xml 1970-01-01 00:00:00 +0000
+++ user_story/report/user_story_report_view.xml 2014-08-12 14:42:57 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<openerp>
3 <data>
4 <report auto="False"
5 id="user_story_report_webkit"
6 model="user.story"
7 name="user.story.report"
8 file="user_story/report/user_story_report.mako"
9 string="User Story Report"
10 report_type="webkit"
11 attachment_use="0"
12 attachment=""
13 menu="True"/>
14 <record id="property_sale_order_vauxoo_report_webkit" model="ir.property">
15 <field name="name">webkit_header</field>
16 <field name="fields_id" ref="report_webkit.field_ir_act_report_xml_webkit_header"/>
17 <field eval="'ir.header_webkit,'+str(ref('user_story.ir_header_webkit_user_story_report'))" model="ir.header_webkit" name="value"/>
18 <field eval="'ir.actions.report.xml,'+str(ref('user_story.user_story_report_webkit'))" model="ir.actions.report.xml" name="res_id"/>
19 </record>
20 </data>
21</openerp>