OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.2 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="report_label_template">
  4. <t t-call="web.basic_layout">
  5. <t t-set="full_width" t-value="True"/>
  6. <t t-set="label_style">
  7. height: <t t-esc="label_format['label_height']"/>mm;
  8. width: <t t-esc="label_format['label_width']"/>mm;
  9. padding-top: <t t-esc="label_format['label_padding_top']"/>mm;
  10. padding-right: <t t-esc="label_format['label_padding_right']"/>mm;
  11. padding-bottom: <t t-esc="label_format['label_padding_bottom']"/>mm;
  12. padding-left: <t t-esc="label_format['label_padding_left']"/>mm;
  13. margin-top: <t t-esc="label_format['label_margin_top']"/>mm;
  14. margin-right: <t t-esc="label_format['label_margin_right']"/>mm;
  15. margin-bottom: <t t-esc="label_format['label_margin_bottom']"/>mm;
  16. margin-left: <t t-esc="label_format['label_margin_left']"/>mm;
  17. display: inline-block;
  18. overflow: hidden;
  19. float: left;
  20. position: relative;
  21. page-break-inside: avoid;
  22. box-sizing: border-box;
  23. </t>
  24. <!-- Offset: Skip the first [offset] labels -->
  25. <t t-foreach="range(0, offset)" t-as="i">
  26. <div t-att-style="label_style"></div>
  27. </t>
  28. <t t-foreach="lines" t-as="line">
  29. <t t-foreach="range(0, line['quantity'])" t-as="i">
  30. <div t-att-style="label_style">
  31. <t t-call="{{label_template}}">
  32. <t t-set="record" t-value="docs.env[res_model].browse(line['res_id'])"/>
  33. </t>
  34. </div>
  35. </t>
  36. </t>
  37. </t>
  38. </template>
  39. <record id="report_label" model="ir.actions.report">
  40. <field name="name">Label Report</field>
  41. <field name="model">report.label.wizard</field>
  42. <field name="report_type">qweb-pdf</field>
  43. <field name="report_name">report_label.report_label_template</field>
  44. <field name="report_file">report_label.report_label_template</field>
  45. </record>
  46. </odoo>