Merge lp:~vauxoo/addons-vauxoo/7.0-imp_user_story_report_description-dev-ernesto into lp:addons-vauxoo/7.0

Status: Merged
Merged at revision: 1060
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-imp_user_story_report_description-dev-ernesto
Merge into: lp:addons-vauxoo/7.0
Diff against target: 73 lines (+55/-0)
3 files modified
user_story/__init__.py (+1/-0)
user_story/report/__init__.py (+1/-0)
user_story/report/parse_report.py (+53/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-imp_user_story_report_description-dev-ernesto
Reviewer Review Type Date Requested Status
Jorge Angel Naranjo Rogel - http://www.vauxoo.com Approve
Luis Ernesto García Medina - http://www.vauxoo.com Pending
Sabrina Romero - http://www.vauxoo.com Pending
Review via email: mp+221791@code.launchpad.net

Description of the change

added function to delete html labels of description field for report of user story

To post a comment you must log in.
1020. By Luis Ernesto García Medina - http://www.vauxoo.com

[IMP][user_story] change library html2text to html from xml

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'user_story/__init__.py'
2--- user_story/__init__.py 2014-05-09 21:51:34 +0000
3+++ user_story/__init__.py 2014-06-12 17:18:07 +0000
4@@ -1,1 +1,2 @@
5 import model
6+import report
7
8=== added file 'user_story/report/__init__.py'
9--- user_story/report/__init__.py 1970-01-01 00:00:00 +0000
10+++ user_story/report/__init__.py 2014-06-12 17:18:07 +0000
11@@ -0,0 +1,1 @@
12+import parse_report
13
14=== added file 'user_story/report/parse_report.py'
15--- user_story/report/parse_report.py 1970-01-01 00:00:00 +0000
16+++ user_story/report/parse_report.py 2014-06-12 17:18:07 +0000
17@@ -0,0 +1,53 @@
18+##############################################################################
19+#
20+# OpenERP, Open Source Management Solution
21+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
22+#
23+
24+#
25+# This program is free software: you can redistribute it and/or modify
26+# it under the terms of the GNU General Public License as published by
27+# the Free Software Foundation, either version 3 of the License, or
28+# (at your option) any later version.
29+#
30+# This program is distributed in the hope that it will be useful,
31+# but WITHOUT ANY WARRANTY; without even the implied warranty of
32+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33+# GNU General Public License for more details.
34+#
35+# You should have received a copy of the GNU General Public License
36+# along with this program. If not, see <http://www.gnu.org/licenses/>.
37+#
38+##############################################################################
39+
40+from openerp.osv import fields, osv
41+from openerp.tools.translate import _
42+
43+from report import report_sxw
44+from lxml import html
45+
46+class story_user_html(report_sxw.rml_parse):
47+
48+ def __init__(self, cr, uid, name, context=None):
49+ if context is None:
50+ context = {}
51+ super(story_user_html, self).__init__(
52+ cr, uid, name, context=context)
53+ self.localcontext.update({
54+ 'parse_html_field' : self._parse_html_field,
55+ })
56+ self.context = context
57+
58+ def _parse_html_field(self, data):
59+ tree = html.fromstring(data)
60+ text_data = tree.text_content()
61+ tree_2 = html.fromstring(text_data)
62+ text_data_2 = tree_2.text_content()
63+ return text_data_2
64+
65+report_sxw.report_sxw('report.user.story.report',
66+ 'user.story',
67+ 'addons/user_story/report/user_story_report.sxw',
68+ parser=story_user_html)
69+
70+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
71
72=== modified file 'user_story/report/user_story_report.sxw'
73Binary files user_story/report/user_story_report.sxw 2014-05-09 21:51:34 +0000 and user_story/report/user_story_report.sxw 2014-06-12 17:18:07 +0000 differ