Merge lp:~unifield-team/unifield-web/web-uf_848 into lp:unifield-web

Proposed by jftempo
Status: Rejected
Rejected by: jftempo
Proposed branch: lp:~unifield-team/unifield-web/web-uf_848
Merge into: lp:unifield-web
Diff against target: 57 lines (+35/-0)
2 files modified
addons/openerp/widgets/listgrid.py (+4/-0)
addons/openerp/widgets/templates/listgrid/text.mako (+31/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/web-uf_848
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+97874@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

4603. By Quentin THEURET @Amaris

UF-848 [IMP] New version of patch

4602. By Quentin THEURET @Amaris

[REVERT] Revert modification in controllers/actions.py
UF-848 [IMP] Add a template for fields.text in listgrid to process it differently than fields.char

4601. By Quentin THEURET @Amaris

UF-848 [IMP] Try to display carriage returns and tabulation of fields.text in tree view

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/openerp/widgets/listgrid.py'
--- addons/openerp/widgets/listgrid.py 2012-02-20 09:55:45 +0000
+++ addons/openerp/widgets/listgrid.py 2012-03-16 13:19:37 +0000
@@ -517,6 +517,9 @@
517 def __str__(self):517 def __str__(self):
518 return ustr(self.text)518 return ustr(self.text)
519519
520class Text(Char):
521 template = "/openerp/widgets/templates/listgrid/text.mako"
522
520class Reference(Char):523class Reference(Char):
521524
522 def get_text(self):525 def get_text(self):
@@ -744,6 +747,7 @@
744747
745CELLTYPES = {748CELLTYPES = {
746 'char':Char,749 'char':Char,
750 'text':Text,
747 'many2one':M2O,751 'many2one':M2O,
748 'reference': Reference,752 'reference': Reference,
749 'datetime':DateTime,753 'datetime':DateTime,
750754
=== added file 'addons/openerp/widgets/templates/listgrid/text.mako'
--- addons/openerp/widgets/templates/listgrid/text.mako 1970-01-01 00:00:00 +0000
+++ addons/openerp/widgets/templates/listgrid/text.mako 2012-03-16 13:19:37 +0000
@@ -0,0 +1,31 @@
1<%!
2 def text_escape(text):
3 p_res = ''
4 p_text = text.split('\n')
5 for line in p_text:
6 p_res += '<p>%s</p>' % line
7
8 t_res = ''
9 t_margin = 0
10 t_text = p_res.split('\t')
11 for tab in t_text:
12 if not tab:
13 t_margin += 10
14 else:
15 t_res += '<span style="margin-left:%spx">%s</span>' % (t_margin, tab)
16 t_margin = 10
17
18 s_res = ''
19 s_text = t_res.split(' ')
20 s_margin = 0
21 for s in s_text:
22 if not s:
23 s_margin += 5
24 else:
25 s_res += '<span style="margin-left:%spx">%s</span>' % (s_margin, s)
26 s_margin = 5
27
28 return s_res or text
29%>
30
31<span name="${name}" value="${value}">${text | text_escape}</span>

Subscribers

People subscribed via source and target branches

to all changes: