Merge lp:~openerp-dev/openobject-server/server-6.0-training-bugfixes into lp:openobject-server/6.0

Proposed by Olivier Laurent (Open ERP)
Status: Rejected
Rejected by: Vo Minh Thu
Proposed branch: lp:~openerp-dev/openobject-server/server-6.0-training-bugfixes
Merge into: lp:openobject-server/6.0
Diff against target: 96 lines (+18/-16)
4 files modified
bin/addons/base/res/res_lang.py (+1/-1)
bin/addons/base/rng/view.rng (+1/-0)
bin/import_xml.rng (+1/-0)
bin/report/render/rml2pdf/trml2pdf.py (+15/-15)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/server-6.0-training-bugfixes
Reviewer Review Type Date Requested Status
Vo Minh Thu (community) Disapprove
Review via email: mp+59206@code.launchpad.net

Description of the change

[FIX] allow inheriting and/or changing style per row inside <blockTable/>
[IMP] Add the link xml attribute in the Relax NG file (used in web client)
[FIX] IndexError for empty 's' parm in res.lang _group() function

To post a comment you must log in.
Revision history for this message
Vo Minh Thu (thu) wrote :

Hi,

The tuple->list conversion seems a bit fragile. Unless there is a compelling reason to do so, this will not be accepted. Anyway, a separate merge proposal would be needed.

The link attribute on the field element is a fragile, unsupported feature. Also, it gives only a false sense of security.

The IndexError will be corrected on its own.

Still, thanks for the merge proposal.

review: Disapprove

Unmerged revisions

3415. By Olivier Laurent (Open ERP)

[FIX] allow inheriting and/or changing style per row inside <blockTable/>

Normally you can to something like this:

<blockTable ... style="terp_style_1">
  <tr ... style="terp_style_2">
    <td></td>
    <td></td>
  </tr>
  <tr ... style="terp_style_2_colspan2">
    <td></td>
  </tr>
</blockTable>

This is permitted by the system and is implemented, BUT actually the table
style inheriting is using tuple() and this avoid any style modification.

The patch simply change tuple() to list() without any futher modification,
to permit a more flexible table style inheriting. (colspan, ...)

3414. By Olivier Laurent (Open ERP)

[IMP] Add the link xml attribute in the Relax NG file

3413. By Olivier Laurent (Open ERP)

[FIX] IndexError for empty 's' parm in res.lang _group() function

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/res/res_lang.py'
2--- bin/addons/base/res/res_lang.py 2011-01-12 16:06:08 +0000
3+++ bin/addons/base/res/res_lang.py 2011-04-27 11:33:56 +0000
4@@ -191,7 +191,7 @@
5 seps = 0
6 spaces = ""
7
8- if s[-1] == ' ':
9+ if s and s[-1] == ' ':
10 sp = s.find(' ')
11 spaces = s[sp:]
12 s = s[:sp]
13
14=== modified file 'bin/addons/base/rng/view.rng'
15--- bin/addons/base/rng/view.rng 2010-12-27 10:41:55 +0000
16+++ bin/addons/base/rng/view.rng 2011-04-27 11:33:56 +0000
17@@ -413,6 +413,7 @@
18 <rng:ref name="overload"/>
19 <rng:ref name="access_rights"/>
20 <rng:optional><rng:attribute name="editable"/></rng:optional>
21+ <rng:optional><rng:attribute name="link"/></rng:optional>
22 <rng:optional><rng:attribute name="domain_filter"/></rng:optional>
23 <rng:optional><rng:attribute name="attrs"/></rng:optional>
24 <rng:optional><rng:attribute name="string"/></rng:optional>
25
26=== modified file 'bin/import_xml.rng'
27--- bin/import_xml.rng 2010-11-27 03:03:04 +0000
28+++ bin/import_xml.rng 2011-04-27 11:33:56 +0000
29@@ -128,6 +128,7 @@
30 <rng:optional><rng:attribute name="search"/></rng:optional>
31 <rng:optional><rng:attribute name="model"/></rng:optional>
32 <rng:optional><rng:attribute name="use"/></rng:optional>
33+ <rng:optional><rng:attribute name="link"/></rng:optional>
34 <rng:oneOrMore>
35 <rng:choice>
36 <rng:ref name="any"/>
37
38=== modified file 'bin/report/render/rml2pdf/trml2pdf.py'
39--- bin/report/render/rml2pdf/trml2pdf.py 2011-01-04 10:13:35 +0000
40+++ bin/report/render/rml2pdf/trml2pdf.py 2011-04-27 11:33:56 +0000
41@@ -172,32 +172,32 @@
42 def _table_style_get(self, style_node):
43 styles = []
44 for node in style_node:
45- start = utils.tuple_int_get(node, 'start', (0,0) )
46- stop = utils.tuple_int_get(node, 'stop', (-1,-1) )
47+ start = utils.tuple_int_get(node, 'start', [0,0] )
48+ stop = utils.tuple_int_get(node, 'stop', [-1,-1] )
49 if node.tag=='blockValign':
50- styles.append(('VALIGN', start, stop, str(node.get('value'))))
51+ styles.append(['VALIGN', start, stop, str(node.get('value'))])
52 elif node.tag=='blockFont':
53- styles.append(('FONT', start, stop, str(node.get('name'))))
54+ styles.append(['FONT', start, stop, str(node.get('name'))])
55 elif node.tag=='blockTextColor':
56- styles.append(('TEXTCOLOR', start, stop, color.get(str(node.get('colorName')))))
57+ styles.append(['TEXTCOLOR', start, stop, color.get(str(node.get('colorName')))])
58 elif node.tag=='blockLeading':
59- styles.append(('LEADING', start, stop, utils.unit_get(node.get('length'))))
60+ styles.append(['LEADING', start, stop, utils.unit_get(node.get('length'))])
61 elif node.tag=='blockAlignment':
62- styles.append(('ALIGNMENT', start, stop, str(node.get('value'))))
63+ styles.append(['ALIGNMENT', start, stop, str(node.get('value'))])
64 elif node.tag=='blockSpan':
65- styles.append(('SPAN', start, stop))
66+ styles.append(['SPAN', start, stop])
67 elif node.tag=='blockLeftPadding':
68- styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.get('length'))))
69+ styles.append(['LEFTPADDING', start, stop, utils.unit_get(node.get('length'))])
70 elif node.tag=='blockRightPadding':
71- styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.get('length'))))
72+ styles.append(['RIGHTPADDING', start, stop, utils.unit_get(node.get('length'))])
73 elif node.tag=='blockTopPadding':
74- styles.append(('TOPPADDING', start, stop, utils.unit_get(node.get('length'))))
75+ styles.append(['TOPPADDING', start, stop, utils.unit_get(node.get('length'))])
76 elif node.tag=='blockBottomPadding':
77- styles.append(('BOTTOMPADDING', start, stop, utils.unit_get(node.get('length'))))
78+ styles.append(['BOTTOMPADDING', start, stop, utils.unit_get(node.get('length'))])
79 elif node.tag=='blockBackground':
80- styles.append(('BACKGROUND', start, stop, color.get(node.get('colorName'))))
81+ styles.append(['BACKGROUND', start, stop, color.get(node.get('colorName'))])
82 if node.get('size'):
83- styles.append(('FONTSIZE', start, stop, utils.unit_get(node.get('size'))))
84+ styles.append(['FONTSIZE', start, stop, utils.unit_get(node.get('size'))])
85 elif node.tag=='lineStyle':
86 kind = node.get('kind')
87 kind_list = [ 'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE','LINEBEFORE', 'LINEAFTER' ]
88@@ -205,7 +205,7 @@
89 thick = 1
90 if node.get('thickness'):
91 thick = float(node.get('thickness'))
92- styles.append((kind, start, stop, thick, color.get(node.get('colorName'))))
93+ styles.append([kind, start, stop, thick, color.get(node.get('colorName'))])
94 return platypus.tables.TableStyle(styles)
95
96 def para_style_get(self, node):