123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?xml version="1.0" encoding="utf-8"?>
- <openerp>
- <data>
- <!-- Report for the original Product Label -->
- <report
- id="report_product_product_label"
- string="Product Label"
- model="product.product.label"
- report_type="qweb-pdf"
- file="product_label"
- name="product_labels.product_product_label"
- />
- <record id="report_product_product_label" model="ir.actions.report.xml">
- <field name="paperformat_id" ref="product_labels.paperformat_product_label"/>
- </record>
- <!-- New Report for Product Label with Price -->
- <report
- id="report_product_product_label_with_price"
- string="Product Label with Price"
- model="product.product.label"
- report_type="qweb-pdf"
- file="product_label_with_price"
- name="product_labels.product_product_label_with_price"
- />
- <record id="report_product_product_label_with_price" model="ir.actions.report.xml">
- <field name="paperformat_id" ref="product_labels.paperformat_product_label"/>
- </record>
- <!-- Original Template -->
- <template id="product_product_label">
- <t t-call="report.html_container">
- <t t-foreach="docs" t-as="label">
- <t t-foreach="label.label_lines" t-as="line">
- <t t-foreach="range(int(line.quantity))" t-as="range_line">
- <div class="page">
- <div class="oe_structure"/>
- <div class="row">
- <table style="width: 100%; border: 1px solid black; text-align: center; border-collapse: collapse;">
- <tr>
- <td colspan="2">
- <h5><span t-field="product.display_name"/>
- </h5>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <span t-if="product.ean13">
- <img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', product.ean13, 600, 13)" style="width:70mm; height:13mm;"/>
- <h5><span t-esc="product.ean13"/></h5>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </t>
- </t>
- </t>
- </t>
- </template>
- <!-- New Template for Label with Price -->
- <template id="product_product_label_with_price">
- <t t-call="report.html_container">
- <t t-foreach="docs" t-as="label">
- <t t-foreach="label.label_lines" t-as="line">
- <t t-foreach="range(int(line.quantity))" t-as="range_line">
- <div class="page">
- <div class="oe_structure"/>
- <div class="row">
- <table style="width: 100%; border: 1px solid black; text-align: center; border-collapse: collapse;">
- <tr>
- <td colspan="2" style="margin: 0; padding: 0;">
- <!-- Verificar que el producto exista antes de mostrar su nombre -->
- <t t-if="product.display_name">
- <h5 style="margin: 0; padding: 0;">
- <span t-field="product.display_name"/>
- </h5>
- </t>
- </td>
- </tr>
- <tr>
- <td colspan="2" style="margin: 0; padding: 0;">
- <!-- Verificar que el producto y el precio existan antes de mostrar el precio -->
- <t t-if="product and product.lst_price">
- <h5 style="margin: 0; padding: 0;">
- Precio: <span t-esc="product.lst_price"/>
- </h5>
- </t>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <span t-if="product.ean13">
- <img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', product.ean13, 600, 13)" style="width:70mm; height:13mm;"/>
- <h5><span t-esc="product.ean13"/></h5>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </t>
- </t>
- </t>
- </t>
- </template>
- </data>
- </openerp>
|