Odoo Help


Fix product labels when name is too large

on 4/5/13, 7:36 AM 2,547 views

I have a rml template to print product labels:

<xsl:template match="object" mode="story">
  <blockTable style="taula2" rowHeights="0.5cm,1.2cm" colWidths="4cm,2.2cm">
      <td colspan="2">
        <para style="nospace"><xsl:value-of select="object.name"/></para>
        <barCode x="1cm" y="1cm" height="1cm" code="EAN13">
          <xsl:value-of select="object.ean13"/>
        <para style="nospace"><b><xsl:text>PVP:</xsl:text></b></para>
        <para style="pvp"><b><xsl:value-of select="object.pvp"/><xsl:text> €</xsl:text></b></para>
  <para style="nospace"></para>

with those stylesheets:

  <paraStyle name="nospace" spaceBefore="0" spaceAfter="0" leading="8">
    <xsl:attribute name="fontName">
      <xsl:value-of select="font_type"/>
    <xsl:attribute name="fontSize">
      <xsl:value-of select="font_size"/>
  <paraStyle name="pvp" spaceBefore="0" spaceAfter="0" fontSize="14" alignment="center">
    <xsl:attribute name="fontName">
      <xsl:value-of select="font_type"/>
  <!-- In this point will be included additional report style sheets -->
  <blockTableStyle id='taula2'>
    <blockAlignment value='CENTER' />
    <blockValign value='MIDDLE' />
    <lineStyle kind='LINEBEFORE' colorName='black' start='0,0' stop='0,1' thickness='1' />
    <lineStyle kind='LINEAFTER' colorName='black' start='0,1' stop='0,1' thickness='1' />
    <lineStyle kind='LINEAFTER' colorName='black' start='1,0' stop='1,1' thickness='1' />
    <lineStyle kind='LINEBELOW' colorName='black' start='0,0' stop='-1,-1' tickness='1' />
    <lineStyle kind='LINEABOVE' colorName='black' start='0,0' stop='-1,-1' tickness='1' />
    <blockBackground colorName="lightgrey" start="0,0" stop="1,0"/>
    <blockValign value='BOTTOM' start='0,0' stop='1,0' />
    <blockFont name="Times-Bold" size="14" start='1,0' stop='1,1' />
    <blockAlignment value="CENTER" start='1,0' stop='1,1' />

but product name is printed outside table when it's too large. How can I get something like what overflow="hidden" does?

I think limiting by name size is not a solution, since the number of characters that fit depend on used font size

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/5/13, 7:36 AM
Seen: 2547 times
Last updated: 3/16/15, 8:10 AM