Odoo Help


This community 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.


Fix product labels when name is too large

on 4/5/13, 7:36 AM 1,801 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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