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
1=== modified file 'user_story/__openerp__.py'
2--- user_story/__openerp__.py 2014-07-25 06:11:04 +0000
3+++ user_story/__openerp__.py 2014-08-12 14:42:57 +0000
4@@ -33,6 +33,7 @@
5 "sprint_kanban",
6 "project_timesheet",
7 "project_conf",
8+ "report_webkit",
9 ],
10 "author" : "Vauxoo",
11 "description" : """
12@@ -47,22 +48,20 @@
13 siguientes:
14
15 .. Story: http://dannorth.net/whats-in-a-story/
16-.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/
17- """,
18+.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""",
19 "website" : "http://vauxoo.com",
20 "category" : "Generic Modules",
21 "demo" : [
22 'demo/demo.xml',
23 ],
24 "data" : [
25- "report/ir_report.xml",
26+ "data/data_us_report.xml",
27+ "report/user_story_report_view.xml",
28 "security/userstory_security.xml",
29 "security/ir.model.access.csv",
30 "view/userstory_view.xml",
31 "view/project_view.xml",
32 "view/hr_timesheet_view.xml",
33- "view/hr_timesheet_all_view.xml",
34- "view/custom_project_task_view.xml",
35 "data/data.xml",
36 "data/user_story_template.xml",
37 ],
38
39=== added file 'user_story/data/data_us_report.xml'
40--- user_story/data/data_us_report.xml 1970-01-01 00:00:00 +0000
41+++ user_story/data/data_us_report.xml 2014-08-12 14:42:57 +0000
42@@ -0,0 +1,378 @@
43+<?xml version="1.0" ?>
44+<openerp>
45+ <data noupdate="0">
46+ <record id="ir_header_webkit_user_story_report" model="ir.header_webkit">
47+ <field name="footer_html"><![CDATA[<!DOCTYPE>
48+ <html>
49+ <head>
50+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
51+ <script>
52+ function subst() {
53+ var vars={};
54+ var x=document.location.search.substring(1).split('&');
55+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
56+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
57+ for(var i in x) {
58+ var y = document.getElementsByClassName(x[i]);
59+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
60+ }
61+ }
62+ </script>
63+ </head>
64+ <body style="border:0; margin: 0;" onload="subst()">
65+ <table style="border-top: 1px solid black; width: 100%">
66+ <tr >
67+ <td style="text-align:left;font-size:7;" width="50%">Generado con software libre en OpenERP y Webkit por http://www.vauxoo.com</td>
68+ <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>
69+ </tr>
70+ </table>
71+ </body>
72+ </html>]]>
73+ </field>
74+ <field name="orientation">Portrait</field>
75+ <field name="format">Letter</field>
76+ <field name="html"><![CDATA[<!DOCTYPE>
77+ <html>
78+ <head>
79+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
80+ <script>
81+ function subst() {
82+ var vars={};
83+ var x=document.location.search.substring(1).split('&');
84+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
85+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
86+ for(var i in x) {
87+ var y = document.getElementsByClassName(x[i]);
88+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
89+ }
90+ }
91+ </script>
92+ <style type="text/css">
93+ ${css}
94+ </style>
95+ </head>
96+ <body style="border:0; margin: 0;" onload="subst()">
97+ ${_debug or ''|n} </body>
98+ </html>]]>
99+ </field>
100+ <field eval="0.0" name="margin_top"/>
101+ <field name="css" ><![CDATA[
102+.table_all_border {
103+ border-collapse: collapse;
104+ width: 100%;
105+ border: 1px solid #f2f2f2; }
106+ .table_all_border > thead > tr > th,
107+ .table_all_border > thead > tr > td,
108+ .table_all_border > tbody > tr > th,
109+ .table_all_border > tbody > tr > td,
110+ .table_all_border > tfoot > tr > th,
111+ .table_all_border > tfoot > tr > td {
112+ border: 1px solid #f2f2f2; }
113+ .table_all_border > thead > tr > th,
114+ .table_all_border > thead > tr > td {
115+ border-bottom-width: 1px solid #f2f2f2; }
116+
117+.table_title_bg_color {
118+ border-collapse: collapse; }
119+ .table_title_bg_color > thead > tr > th,
120+ .table_title_bg_color > tbody > tr > th,
121+ .table_title_bg_color > tfoot > tr > th {
122+ border-bottom: 1px solid #f2f2f2;
123+ border-top: 1px solid #f2f2f2;
124+ background-color: #A41D35;
125+ font-size: 7;
126+ color: white; }
127+
128+.table_title {
129+ border-collapse: collapse;
130+ width: 100%; }
131+ .table_title > thead > tr > th,
132+ .table_title > tbody > tr > th,
133+ .table_title > tfoot > tr > th {
134+ border-bottom: 2px solid #f2f2f2;
135+ font-size: 7;
136+ color: white; }
137+
138+.table_row_border {
139+ border-collapse: collapse;
140+ width: 100%; }
141+ .table_row_border > thead > tr > th,
142+ .table_row_border > thead > tr > td,
143+ .table_row_border > tbody > tr > th,
144+ .table_row_border > tbody > tr > td,
145+ .table_row_border > tfoot > tr > th,
146+ .table_row_border > tfoot > tr > td {
147+ border-bottom: 1px solid #f2f2f2; }
148+ .table_row_border > thead > tr > th,
149+ .table_row_border > thead > tr > td {
150+ border-bottom-width: 1px; }
151+
152+.table_column_border {
153+ border-collapse: collapse;
154+ }
155+ .table_column_border > thead > tr > td,
156+ .table_column_border > tbody > tr > td,
157+ .table_column_border > tfoot > tr > td {
158+ border: 1px solid #f2f2f2;
159+ border-width: 0 1px; }
160+ .table_column_border > thead > tr > td:first-child, .table_column_border > thead > tr td + td,
161+ .table_column_border > tbody > tr > td:first-child,
162+ .table_column_border > tbody > tr td + td,
163+ .table_column_border > tfoot > tr > td:first-child,
164+ .table_column_border > tfoot > tr td + td {
165+ border-left: 0; }
166+ .table_column_border > thead > tr > td:last-child,
167+ .table_column_border > tbody > tr > td:last-child,
168+ .table_column_border > tfoot > tr > td:last-child {
169+ padding-right: 0;
170+ border-right: 0; }
171+
172+.table_alter_color_row {
173+ border-collapse: collapse; }
174+ .table_alter_color_row > tbody > tr:nth-child(2n+1) > td {
175+ background-color: gainsboro ; }
176+ .table_alter_color_row > tbody > tr:nth-child(2n+2) > td {
177+ background-color: whitesmoke; }
178+
179+.table_alter_color_column {
180+ border-collapse: collapse;
181+ width: 100%; }
182+ .table_alter_color_column > tbody
183+ > tr
184+ > td:nth-child(2n+1) {
185+ background-color: gainsboro; }
186+ .table_alter_color_column > tbody
187+ > tr
188+ > td:nth-child(2n+2) {
189+ background-color: whitesmoke; }
190+
191+.table_only_border_top {
192+ border-collapse: collapse;
193+ width: 100%; }
194+ .table_only_border_top > tbody
195+ > tr {
196+ border-top: 1px solid #f2f2f2; }
197+
198+.table_only_border_bottom {
199+ border-collapse: collapse;
200+ width: 100%; }
201+ .table_only_border_bottom > tbody
202+ > tr {
203+ border-bottom: 1px solid #f2f2f2; }
204+
205+.panel {
206+ padding: 8px 8px;
207+ background-color: #5bc0de; }
208+
209+.panel_radius_color {
210+ border: 2px solid #ee8f9e;
211+ border-radius: 15px;
212+ padding: 8px 8px; }
213+
214+.panel_radius_trans {
215+ border: 2px solid transparent;
216+ border-radius: 15px;
217+ padding: 8px 8px; }
218+
219+.panel_bg_color {
220+ padding: 5px 5px;
221+ background: #f2f2f2;
222+ font-size: 6pt; }
223+
224+.panel_bg_color_title {
225+ padding: 5px 5px;
226+ background: #A41D35;
227+ color: white;
228+ font-size: 6pt;
229+ font-family: "Helvetica Neue", Helvetica, Arial, sans_serif; }
230+
231+.panel_box_shadow {
232+ box-shadow: 5px 5px 10px #222222; }
233+
234+.panel_bg_color_gradient {
235+ background: -webkit-linear-gradient(#333333, gainsboro);
236+ /* For Safari */
237+ background: -o-linear-gradient(#333333, gainsboro);
238+ /* For Opera 11.1 to 12.0 */
239+ background: -moz-linear-gradient(#333333, gainsboro);
240+ /* For Firefox 3.6 to 15 */
241+ background: linear-gradient(#333333, gainsboro);
242+ /* Standard syntax (must be last) */ }
243+
244+.panel_border_radius_top {
245+ border-top-right-radius: 15px;
246+ border-top-left-radius: 15px;
247+ border: 2px solid #ee8f9e;
248+ padding: 5px; }
249+
250+.panel_radius_top {
251+ border-top-right-radius: 15px;
252+ border-top-left-radius: 15px;
253+ padding: 5px; }
254+
255+.panel_border_radius_top_right {
256+ border-top-right-radius: 15px;
257+ border: 2px solid #ee8f9e;
258+ padding: 5px; }
259+
260+.panel_border_radius_top_left {
261+ border-top-left-radius: 15px;
262+ border: 2px solid #ee8f9e;
263+ padding: 5px; }
264+
265+.panel_border_radius_bottom {
266+ border-bottom-right-radius: 15px;
267+ border-bottom-left-radius: 15px;
268+ border: 2px solid #ee8f9e;
269+ padding: 5px; }
270+
271+.panel_radius_bottom {
272+ border-bottom-right-radius: 15px;
273+ border-bottom-left-radius: 15px;
274+ padding: 5px; }
275+
276+.panel_border_radius_bottom_right {
277+ border-bottom-right-radius: 15px;
278+ border: 2px solid #ee8f9e;
279+ padding: 5px; }
280+
281+.panel_border_radius_bottom_left {
282+ border-bottom-left-radius: 15px;
283+ border: 2px solid #ee8f9e;
284+ padding: 5px; }
285+
286+body {
287+ color: black;
288+ font-family: "Helvetica Neue", Helvetica, Arial, sans_serif;
289+ font-size: 7;
290+ margin: 0;
291+ padding: 0;
292+ height: 100%;
293+ line-height: 12px; }
294+
295+table.basic_table {
296+ border-collapse: collapse;
297+ width: 100%; }
298+
299+.imagen_company {
300+ vertical-align: top;
301+ width: 35%; }
302+
303+.data_emitter {
304+ vertical-align: top;
305+ color: black;
306+ text-align: right;
307+ font-size: 7; }
308+
309+.data_customer {
310+ vertical-align: top;
311+ color: black;
312+ text-align: left;
313+ font-size: 7; }
314+
315+th {
316+ padding-right: 2px;
317+ padding-left: 2px;
318+ text-align: center;
319+ font-size: 7; }
320+
321+strong{
322+ font-size: 18;
323+ font-weight: bold;
324+}
325+
326+.data_company{
327+ font-size: 10;
328+}
329+
330+
331+pre {
332+ font-size: 12pt;
333+ font-family: helvetica;
334+ white-space: pre-wrap;
335+ white-space: -moz-pre-wrap !important;
336+ white-space: -pre-wrap;
337+ white-space: -o-pre-wrap;
338+ word-wrap: break-word; }
339+
340+
341+.pre_description {
342+ font-size: 6pt;
343+ font-family: helvetica;
344+ white-space: pre-wrap;
345+ white-space: -moz-pre-wrap !important;
346+ white-space: -pre-wrap;
347+ white-space: -o-pre-wrap;
348+ word-wrap: break-word;
349+ background: #f2f2f2; }
350+
351+hr{
352+ width:95%;
353+ color:lightgrey;
354+}
355+
356+td{
357+ font-size:7;
358+}
359+
360+.td_without_bottom{
361+ border-bottom: 1px solid #FFFFFF;
362+}
363+
364+.td_amount{
365+ text-align:right
366+}
367+
368+.td_center {
369+text-align: center; }
370+
371+.th_center {
372+text-align: center; }
373+
374+.td_bold {
375+font-weight: bold; }
376+
377+.th_widht {
378+ width: 33%; }
379+
380+.td_condiciones{
381+ font-size:6;
382+}
383+
384+table.fixed {
385+table-layout:fixed;
386+width:33%;
387+word-break:break-all;
388+}
389+
390+td.total_td {
391+border-top: solid 1.5px #A41D35;
392+font-size: 8;
393+padding-right: 2px;
394+padding-left: 2px;
395+font-weight: bold;
396+color: black; }
397+
398+td.sub_total_td {
399+border-top: solid 1.5px #A41D35;
400+font-size: 8;
401+padding-right: 2px;
402+padding-left: 2px;
403+color: black; }
404+
405+
406+.td_vertical_middle {
407+ vertical-align: middle; }
408+p.td_margin_botton {
409+margin-bottom:20px;
410+}
411+
412+]]> </field>
413+ <field name="name">User Story Report Vauxoo Webkit</field>
414+ </record>
415+ <record id="ir_header_img_companylogo0" model="ir.header_img">
416+ <field eval="&quot;&quot;&quot;jpg&quot;&quot;&quot;" name="type"/>
417+ <field eval="&quot;&quot;&quot;company_logo&quot;&quot;&quot;" name="name"/>
418+ </record>
419+ </data>
420+</openerp>
421
422=== modified file 'user_story/i18n/es.po'
423--- user_story/i18n/es.po 2014-08-09 05:43:24 +0000
424+++ user_story/i18n/es.po 2014-08-12 14:42:57 +0000
425@@ -110,6 +110,7 @@
426 #. module: user_story
427 #: field:acceptability.criteria,scenario:0
428 #: view:user.story:0
429+#: report:addons/user_story/report/user_story_report.mako:47
430 msgid "Scenario"
431 msgstr "Escenario"
432
433@@ -190,6 +191,7 @@
434 #. module: user_story
435 #: view:project.task:0
436 #: field:user.story,planned_hours:0
437+#: report:addons/user_story/report/user_story_report.mako:26
438 msgid "Planned Hours"
439 msgstr "Horas Estimadas"
440
441@@ -352,6 +354,7 @@
442 #. module: user_story
443 #: view:user.story:0
444 #: field:user.story,owner:0
445+#: report:addons/user_story/report/user_story_report.mako:22
446 msgid "Owner"
447 msgstr "Dueño"
448
449@@ -416,6 +419,7 @@
450 #: view:project.task:0
451 #: field:project.task,userstory_id:0
452 #: view:user.story:0
453+#: report:addons/user_story/report/user_story_report.mako:10
454 msgid "User Story"
455 msgstr "Historia de Usuario"
456
457@@ -616,6 +620,7 @@
458 #: view:project.project:0
459 #: field:project.project,descriptions:0
460 #: field:user.story,description:0
461+#: report:addons/user_story/report/user_story_report.mako:33
462 msgid "Description"
463 msgstr "Descripción"
464
465@@ -670,6 +675,7 @@
466
467 #. module: user_story
468 #: field:user.story.priority,name:0
469+#: report:addons/user_story/report/user_story_report.mako:46
470 msgid "Name"
471 msgstr "Nombre"
472
473@@ -680,6 +686,7 @@
474
475 #. module: user_story
476 #: view:acceptability.criteria:0
477+#: report:addons/user_story/report/user_story_report.mako:41
478 msgid "Acceptability Criterion"
479 msgstr "Criterio de Aceptación"
480
481@@ -738,3 +745,14 @@
482 #: view:user.story:0
483 msgid "Sprint"
484 msgstr "Sprint"
485+
486+#. module: user_story
487+#: view:user.story:0
488+#: report:addons/user_story/report/user_story_report.mako:18
489+msgid "Related Project"
490+msgstr "Proyecto Relacionado"
491+
492+#. module: user_story
493+#: model:ir.actions.report.xml,name:user_story.user_story_report_webkit
494+msgid "User Story Report"
495+msgstr "Reporte de Historia de Usuario"
496\ No newline at end of file
497
498=== modified file 'user_story/i18n/user_story.pot'
499--- user_story/i18n/user_story.pot 2014-05-09 21:51:34 +0000
500+++ user_story/i18n/user_story.pot 2014-08-12 14:42:57 +0000
501@@ -104,6 +104,7 @@
502
503 #. module: user_story
504 #: field:acceptability.criteria,scenario:0
505+#: report:addons/user_story/report/user_story_report.mako:47
506 #: view:user.story:0
507 msgid "Scenario"
508 msgstr ""
509@@ -514,6 +515,8 @@
510 msgid "sc 1.2"
511 msgstr ""
512
513+
514+
515 #. module: user_story
516 #: model:acceptability.criteria,scenario:user_story.ac_11
517 msgid "sc 1.1"
518@@ -608,6 +611,7 @@
519
520 #. module: user_story
521 #: field:user.story.priority,name:0
522+#: report:addons/user_story/report/user_story_report.mako:46
523 msgid "Name"
524 msgstr ""
525
526@@ -674,4 +678,3 @@
527 #: view:user.story:0
528 msgid "Sprint"
529 msgstr ""
530-
531
532=== modified file 'user_story/report/__init__.py'
533--- user_story/report/__init__.py 2014-05-31 22:07:48 +0000
534+++ user_story/report/__init__.py 2014-08-12 14:42:57 +0000
535@@ -1,1 +1,2 @@
536-import parse_report
537+#~ import parse_report
538+import user_story_report_mako
539
540=== modified file 'user_story/report/parse_report.py'
541--- user_story/report/parse_report.py 2014-08-02 05:34:10 +0000
542+++ user_story/report/parse_report.py 2014-08-12 14:42:57 +0000
543@@ -36,9 +36,14 @@
544 self.context = context
545
546 def _parse_html_field(self, data):
547- tree = html.fromstring(data)
548- text_data = tree.text_content()
549- return text_data
550+ if data:
551+ data_str = data.encode('ascii', 'xmlcharrefreplace')
552+ data_str = data_str.replace('<br>', '\n')
553+ root = html.fromstring(data_str)
554+ text_data = html.tostring(root, encoding='unicode', method='text')
555+ text_data = text_data.encode('ascii', 'xmlcharrefreplace')
556+ return text_data
557+ return ''
558
559 report_sxw.report_sxw('report.user.story.report',
560 'user.story',
561
562=== added file 'user_story/report/user_story_report.mako'
563--- user_story/report/user_story_report.mako 1970-01-01 00:00:00 +0000
564+++ user_story/report/user_story_report.mako 2014-08-12 14:42:57 +0000
565@@ -0,0 +1,59 @@
566+<html>
567+ <head>
568+ <style type="text/css">${css}</style>
569+ </head>
570+ <body>
571+ <% setLang(user.lang) %>
572+ % for user.story in objects:
573+ <table width="100%">
574+ <tr>
575+ <th class="panel_bg_color_title">${_("User Story")}</th>
576+ </tr>
577+ <tr>
578+ <td class="td_center"><h5><p class="td_margin">${user and user.story and user.story.name}</p></h5></td>
579+ </tr>
580+ </table>
581+ <table width="100%">
582+ <tr>
583+ <th class="th_center panel_bg_color_title">${_("Related Project")}</th>
584+ <td class="panel_bg_color">${user and user.story and user.story.project_id and user.story.project_id.name}</td>
585+ </tr>
586+ <tr>
587+ <th class="th_center panel_bg_color_title">${_("Owner")}</th>
588+ <td class="panel_bg_color">${user and user.story and user.story.owner_id and user.story.owner_id.name}</td>
589+ </tr>
590+ <tr>
591+ <th class="th_center panel_bg_color_title">${_("Planned Hours")}</th>
592+ <td class="panel_bg_color">${user and user.story and user.story.planned_hours}</td>
593+ </tr>
594+ </table>
595+ <p class="td_margin"></br></p>
596+ <table width="100%">
597+ <tr>
598+ <th class="panel_bg_color_title">${_("Description")}</th>
599+ </tr>
600+ <tr>
601+ <td class="pre_description">${parse_html_field(user.story.description)}</td>
602+ </tr>
603+ </table>
604+ <table width="100%">
605+ <tr>
606+ <th class="panel_bg_color_title">${_("Acceptability Criterion")}</th>
607+ </tr>
608+ </table>
609+ <table width="100%">
610+ <tr>
611+ <th class="th_center panel_bg_color_title">${_("Name")}</th>
612+ <th class="th_center panel_bg_color_title">${_("Scenario")}</th>
613+ </tr>
614+ % for criteria in (user and user.story and user.story.accep_crit_ids):
615+ <tr>
616+ <td class="panel_bg_color">${criteria.name}</td>
617+ <td class="panel_bg_color">${criteria.scenario}</td>
618+ </tr>
619+ % endfor
620+ </table>
621+ <p style="page-break-before: always;"></p>
622+ % endfor
623+ </body>
624+</html>
625
626=== added file 'user_story/report/user_story_report_mako.py'
627--- user_story/report/user_story_report_mako.py 1970-01-01 00:00:00 +0000
628+++ user_story/report/user_story_report_mako.py 2014-08-12 14:42:57 +0000
629@@ -0,0 +1,61 @@
630+#!/usr/bin/python
631+# -*- encoding: utf-8 -*-
632+#
633+# Module Writen to OpenERP, Open Source Management Solution
634+#
635+# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
636+# All Rights Reserved.
637+# info Vauxoo (info@vauxoo.com)
638+#
639+# Coded by: vauxoo consultores (info@vauxoo.com)
640+#
641+#
642+# This program is free software: you can redistribute it and/or modify
643+# it under the terms of the GNU Affero General Public License as
644+# published by the Free Software Foundation, either version 3 of the
645+# License, or (at your option) any later version.
646+#
647+# This program is distributed in the hope that it will be useful,
648+# but WITHOUT ANY WARRANTY; without even the implied warranty of
649+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
650+# GNU Affero General Public License for more details.
651+#
652+# You should have received a copy of the GNU Affero General Public License
653+# along with this program. If not, see <http://www.gnu.org/licenses/>.
654+#
655+
656+from openerp.osv import fields, osv
657+from openerp.tools.translate import _
658+from report_webkit import webkit_report
659+from report import report_sxw
660+from lxml import html
661+import xml
662+
663+class user_story_report(report_sxw.rml_parse):
664+
665+ def __init__(self, cr, uid, name, context=None):
666+ if context is None:
667+ context = {}
668+ super(user_story_report, self).__init__(
669+ cr, uid, name, context=context)
670+ self.localcontext.update({
671+ 'parse_html_field' : self._parse_html_field,
672+ })
673+ self.context = context
674+
675+ def _parse_html_field(self, data):
676+ if data:
677+ data_str = data.encode('ascii', 'xmlcharrefreplace')
678+ data_str = data_str.replace('<br>', '\n')
679+ root = html.fromstring(data_str)
680+ text_data = html.tostring(root, encoding='unicode', method='text')
681+ text_data = text_data.encode('ascii', 'xmlcharrefreplace')
682+ return text_data
683+ return ''
684+
685+webkit_report.WebKitParser('report.user.story.report',
686+ 'user.story',
687+ 'addons/user_story/report/user_story_report.mako',
688+ parser=user_story_report)
689+
690+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
691
692=== added file 'user_story/report/user_story_report_view.xml'
693--- user_story/report/user_story_report_view.xml 1970-01-01 00:00:00 +0000
694+++ user_story/report/user_story_report_view.xml 2014-08-12 14:42:57 +0000
695@@ -0,0 +1,21 @@
696+<?xml version="1.0" encoding="UTF-8" ?>
697+<openerp>
698+ <data>
699+ <report auto="False"
700+ id="user_story_report_webkit"
701+ model="user.story"
702+ name="user.story.report"
703+ file="user_story/report/user_story_report.mako"
704+ string="User Story Report"
705+ report_type="webkit"
706+ attachment_use="0"
707+ attachment=""
708+ menu="True"/>
709+ <record id="property_sale_order_vauxoo_report_webkit" model="ir.property">
710+ <field name="name">webkit_header</field>
711+ <field name="fields_id" ref="report_webkit.field_ir_act_report_xml_webkit_header"/>
712+ <field eval="'ir.header_webkit,'+str(ref('user_story.ir_header_webkit_user_story_report'))" model="ir.header_webkit" name="value"/>
713+ <field eval="'ir.actions.report.xml,'+str(ref('user_story.user_story_report_webkit'))" model="ir.actions.report.xml" name="res_id"/>
714+ </record>
715+ </data>
716+</openerp>