Skip to Content
Menu
This question has been flagged
2 Replies
5682 Views

Im trying to print product labels for the product variant , each variant has variant attributes like size and color. For me it only prints one variant attribute for each variant like only size or only color, any ideas how to print multipe?

There is a link to the image displaying my issue

http://s1.postimg.org/oopgmal67/product_label.png

Any help would be appreciated

Thanks

Avatar
Discard

Hello Darius, http://tidyway.blogspot.in/2015/01/barcode-label-report-in-odoo-v8.html

Best Answer

For Printing Variant Attributes and Attributes Price for the product ..

in product/report/product-label.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<lots>
 <lot-line type="fields" name="id">
 <code type="field" name="code"/>
 <product type="field" name="name"/>
<price type="field" name="lst_price"/>
 <ean13 type="field" name="ean13"/>
 <currency type="field" name="company_id.currency_id.name"/>
 <!--.....editingg....-->
 <attribute_value_ids type="zoom" name="attribute_value_ids">
 <attribute_value_ids_name type="field" name="name"/>
 </attribute_value_ids>
 <!--......end....-->
 </lot-line>
</lots>

and u also need to some changes in product_label.xsl

<xsl:template match="lot-line" mode="story"> 
 <blockTable style="mytable" colWidths="2.8cm,5.4cm">
 <tr>
 <td>
 <para style="nospace"><xsl:value-of select="code"/></para>
 </td>
 <td>
 <para style="nospace" t="1"><xsl:value-of select="price"/><xsl:text> </xsl:text><xsl:value-of select="currency"/></para>
 </td>
 </tr>
 <tr>
 <td>
 <barCode>
<xsl:value-of select="ean13" />
</barCode>
 </td>
 <td>
 <!--......................Instead of this write the below line for the variant..............-->
 <!--<para style="nospace"><xsl:value-of select="substring(product, 1, $pmaxChars)"/></para><xsl:text>, </xsl:text>-->
 <!--<para style="nospace"><xsl:value-of select="variant"/></para>-->
 <para style="nospace"><xsl:value-of select="substring(product, 1, $pmaxChars)"/></para><xsl:text>, </xsl:text>
 <para style="nospace"><xsl:apply-templates select="attribute_value_ids"/></para>
 <!--........................................End............................................-->
 </td>
 </tr>
 </blockTable>
<nextFrame/>
</xsl:template>
Avatar
Discard
Related Posts Replies Views Activity
3
Nov 24
5846
3
Sep 24
4398
0
May 22
2276
2
Jan 20
3596
0
Dec 17
2805