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
=== modified file 'bin/addons/base/res/res_lang.py'
--- bin/addons/base/res/res_lang.py 2011-01-12 16:06:08 +0000
+++ bin/addons/base/res/res_lang.py 2011-04-27 11:33:56 +0000
@@ -191,7 +191,7 @@
191 seps = 0191 seps = 0
192 spaces = ""192 spaces = ""
193193
194 if s[-1] == ' ':194 if s and s[-1] == ' ':
195 sp = s.find(' ')195 sp = s.find(' ')
196 spaces = s[sp:]196 spaces = s[sp:]
197 s = s[:sp]197 s = s[:sp]
198198
=== modified file 'bin/addons/base/rng/view.rng'
--- bin/addons/base/rng/view.rng 2010-12-27 10:41:55 +0000
+++ bin/addons/base/rng/view.rng 2011-04-27 11:33:56 +0000
@@ -413,6 +413,7 @@
413 <rng:ref name="overload"/>413 <rng:ref name="overload"/>
414 <rng:ref name="access_rights"/>414 <rng:ref name="access_rights"/>
415 <rng:optional><rng:attribute name="editable"/></rng:optional>415 <rng:optional><rng:attribute name="editable"/></rng:optional>
416 <rng:optional><rng:attribute name="link"/></rng:optional>
416 <rng:optional><rng:attribute name="domain_filter"/></rng:optional>417 <rng:optional><rng:attribute name="domain_filter"/></rng:optional>
417 <rng:optional><rng:attribute name="attrs"/></rng:optional>418 <rng:optional><rng:attribute name="attrs"/></rng:optional>
418 <rng:optional><rng:attribute name="string"/></rng:optional>419 <rng:optional><rng:attribute name="string"/></rng:optional>
419420
=== modified file 'bin/import_xml.rng'
--- bin/import_xml.rng 2010-11-27 03:03:04 +0000
+++ bin/import_xml.rng 2011-04-27 11:33:56 +0000
@@ -128,6 +128,7 @@
128 <rng:optional><rng:attribute name="search"/></rng:optional>128 <rng:optional><rng:attribute name="search"/></rng:optional>
129 <rng:optional><rng:attribute name="model"/></rng:optional>129 <rng:optional><rng:attribute name="model"/></rng:optional>
130 <rng:optional><rng:attribute name="use"/></rng:optional>130 <rng:optional><rng:attribute name="use"/></rng:optional>
131 <rng:optional><rng:attribute name="link"/></rng:optional>
131 <rng:oneOrMore>132 <rng:oneOrMore>
132 <rng:choice>133 <rng:choice>
133 <rng:ref name="any"/>134 <rng:ref name="any"/>
134135
=== modified file 'bin/report/render/rml2pdf/trml2pdf.py'
--- bin/report/render/rml2pdf/trml2pdf.py 2011-01-04 10:13:35 +0000
+++ bin/report/render/rml2pdf/trml2pdf.py 2011-04-27 11:33:56 +0000
@@ -172,32 +172,32 @@
172 def _table_style_get(self, style_node):172 def _table_style_get(self, style_node):
173 styles = []173 styles = []
174 for node in style_node:174 for node in style_node:
175 start = utils.tuple_int_get(node, 'start', (0,0) )175 start = utils.tuple_int_get(node, 'start', [0,0] )
176 stop = utils.tuple_int_get(node, 'stop', (-1,-1) )176 stop = utils.tuple_int_get(node, 'stop', [-1,-1] )
177 if node.tag=='blockValign':177 if node.tag=='blockValign':
178 styles.append(('VALIGN', start, stop, str(node.get('value'))))178 styles.append(['VALIGN', start, stop, str(node.get('value'))])
179 elif node.tag=='blockFont':179 elif node.tag=='blockFont':
180 styles.append(('FONT', start, stop, str(node.get('name'))))180 styles.append(['FONT', start, stop, str(node.get('name'))])
181 elif node.tag=='blockTextColor':181 elif node.tag=='blockTextColor':
182 styles.append(('TEXTCOLOR', start, stop, color.get(str(node.get('colorName')))))182 styles.append(['TEXTCOLOR', start, stop, color.get(str(node.get('colorName')))])
183 elif node.tag=='blockLeading':183 elif node.tag=='blockLeading':
184 styles.append(('LEADING', start, stop, utils.unit_get(node.get('length'))))184 styles.append(['LEADING', start, stop, utils.unit_get(node.get('length'))])
185 elif node.tag=='blockAlignment':185 elif node.tag=='blockAlignment':
186 styles.append(('ALIGNMENT', start, stop, str(node.get('value'))))186 styles.append(['ALIGNMENT', start, stop, str(node.get('value'))])
187 elif node.tag=='blockSpan':187 elif node.tag=='blockSpan':
188 styles.append(('SPAN', start, stop))188 styles.append(['SPAN', start, stop])
189 elif node.tag=='blockLeftPadding':189 elif node.tag=='blockLeftPadding':
190 styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.get('length'))))190 styles.append(['LEFTPADDING', start, stop, utils.unit_get(node.get('length'))])
191 elif node.tag=='blockRightPadding':191 elif node.tag=='blockRightPadding':
192 styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.get('length'))))192 styles.append(['RIGHTPADDING', start, stop, utils.unit_get(node.get('length'))])
193 elif node.tag=='blockTopPadding':193 elif node.tag=='blockTopPadding':
194 styles.append(('TOPPADDING', start, stop, utils.unit_get(node.get('length'))))194 styles.append(['TOPPADDING', start, stop, utils.unit_get(node.get('length'))])
195 elif node.tag=='blockBottomPadding':195 elif node.tag=='blockBottomPadding':
196 styles.append(('BOTTOMPADDING', start, stop, utils.unit_get(node.get('length'))))196 styles.append(['BOTTOMPADDING', start, stop, utils.unit_get(node.get('length'))])
197 elif node.tag=='blockBackground':197 elif node.tag=='blockBackground':
198 styles.append(('BACKGROUND', start, stop, color.get(node.get('colorName'))))198 styles.append(['BACKGROUND', start, stop, color.get(node.get('colorName'))])
199 if node.get('size'):199 if node.get('size'):
200 styles.append(('FONTSIZE', start, stop, utils.unit_get(node.get('size'))))200 styles.append(['FONTSIZE', start, stop, utils.unit_get(node.get('size'))])
201 elif node.tag=='lineStyle':201 elif node.tag=='lineStyle':
202 kind = node.get('kind')202 kind = node.get('kind')
203 kind_list = [ 'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE','LINEBEFORE', 'LINEAFTER' ]203 kind_list = [ 'GRID', 'BOX', 'OUTLINE', 'INNERGRID', 'LINEBELOW', 'LINEABOVE','LINEBEFORE', 'LINEAFTER' ]
@@ -205,7 +205,7 @@
205 thick = 1205 thick = 1
206 if node.get('thickness'):206 if node.get('thickness'):
207 thick = float(node.get('thickness'))207 thick = float(node.get('thickness'))
208 styles.append((kind, start, stop, thick, color.get(node.get('colorName'))))208 styles.append([kind, start, stop, thick, color.get(node.get('colorName'))])
209 return platypus.tables.TableStyle(styles)209 return platypus.tables.TableStyle(styles)
210210
211 def para_style_get(self, node):211 def para_style_get(self, node):