report_product_labels.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- Reporte original para la etiqueta del producto -->
  5. <report
  6. id="product.report_product_label"
  7. string="Product Label"
  8. model="product.product"
  9. report_type="qweb-pdf"
  10. file="product_label"
  11. name="product_labels.product_label"
  12. />
  13. <record id="product.report_product_label" model="ir.actions.report.xml">
  14. <field name="paperformat_id" ref="product_labels.paperformat_product_label"/>
  15. </record>
  16. <!-- Nuevo reporte para la etiqueta con precio -->
  17. <report
  18. id="product.report_product_label_with_price"
  19. string="Product Label with Price"
  20. model="product.product"
  21. report_type="qweb-pdf"
  22. file="product_label_with_price"
  23. name="product_labels.product_label_with_price"
  24. />
  25. <record id="product.report_product_label_with_price" model="ir.actions.report.xml">
  26. <field name="paperformat_id" ref="product_labels.paperformat_product_label"/>
  27. </record>
  28. <!-- Plantilla original -->
  29. <template id="product_label">
  30. <!-- Multicompany -->
  31. <t t-if="o and 'company_id' in o">
  32. <t t-set="company" t-value="o.company_id"/>
  33. </t>
  34. <t t-if="not o or not 'company_id' in o">
  35. <t t-set="company" t-value="res_company"/>
  36. </t>
  37. <t t-call="report.html_container">
  38. <t t-foreach="docs" t-as="product">
  39. <div class="page">
  40. <div class="oe_structure"/>
  41. <div class="row">
  42. <table style="width: 100%; border: 1px solid black; text-align: center; border-collapse: collapse; margin: 0; padding: 0;">
  43. <tr>
  44. <td colspan="2" style="margin: 0; padding: 0;">
  45. <h5 style="margin: 0; padding: 0;">
  46. <span t-field="product.display_name"/>
  47. </h5>
  48. </td>
  49. </tr>
  50. <tr style="border: 1px solid black; margin: 0; padding: 0;">
  51. <td colspan="2" style="margin: 0; padding: 0;">
  52. <span t-if="product.ean13">
  53. <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.ean13, 600, 13)" style="margin-top: 1px; width:70mm; height:13mm; margin: 0; padding: 0;"/>
  54. <h5 style="margin: 0; padding: 0;"><span t-esc="product.ean13" /></h5>
  55. </span>
  56. </td>
  57. </tr>
  58. </table>
  59. </div>
  60. </div>
  61. </t>
  62. </t>
  63. </template>
  64. <!-- Nueva plantilla con precio -->
  65. <template id="product_label_with_price">
  66. <!-- Multicompany -->
  67. <t t-if="o and 'company_id' in o">
  68. <t t-set="company" t-value="o.company_id"/><t t-if="product">
  69. <h5><span t-field="product.display_name"/></h5>
  70. </t>
  71. </t>
  72. <t t-if="not o or not 'company_id' in o">
  73. <t t-set="company" t-value="res_company"/>
  74. </t>
  75. <t t-call="report.html_container">
  76. <t t-foreach="docs" t-as="product">
  77. <div class="page">
  78. <div class="oe_structure"/>
  79. <div class="row">
  80. <table style="width: 100%; border: 1px solid black; text-align: center; border-collapse: collapse; margin: 0; padding: 0;">
  81. <tr>
  82. <td colspan="2" style="margin: 0; padding: 0;">
  83. <h5 style="margin: 0; padding: 0;">
  84. <span t-field="product.display_name"/>
  85. </h5>
  86. </td>
  87. </tr>
  88. <!-- Nueva fila para mostrar el precio -->
  89. <tr>
  90. <td colspan="2" style="margin: 0; padding: 0;">
  91. <h5 style="margin: 0; padding: 0;">
  92. <span>Precio: </span><span t-field="product.lst_price" />
  93. </h5>
  94. </td>
  95. </tr>
  96. <tr style="border: 1px solid black; margin: 0; padding: 0;">
  97. <td colspan="2" style="margin: 0; padding: 0;">
  98. <span t-if="product.ean13">
  99. <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.ean13, 600, 13)" style="margin-top: 1px; width:70mm; height:13mm; margin: 0; padding: 0;"/>
  100. <h5 style="margin: 0; padding: 0;"><span t-esc="product.ean13" /></h5>
  101. </span>
  102. </td>
  103. </tr>
  104. </table>
  105. </div>
  106. </div>
  107. </t>
  108. </t>
  109. </template>
  110. </data>
  111. </openerp>