Skip to content

Instantly share code, notes, and snippets.

@filoquin
Created May 20, 2020 14:04
Show Gist options
  • Select an option

  • Save filoquin/d6f2c3e014a1269ec7bce555db561d71 to your computer and use it in GitHub Desktop.

Select an option

Save filoquin/d6f2c3e014a1269ec7bce555db561d71 to your computer and use it in GitHub Desktop.
Ejemplo de remito Preimpreso en qweb
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="paperformat_preimpreso" model="report.paperformat">
<field name="name">preimpreso</field>
<field eval="False" name="default"/>
<field name="format">A4</field>
<field name="orientation">Portrait</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field eval="False" name="header_line"/>
<field name="header_spacing">0</field>
<field name="dpi">72</field>
</record>
<template id="report_preimpreso_internal">
<span style="position:absolute; left:130mm;top:25mm" t-field="o.min_date" t-field-options='{"format": "dd/mm/yyyy"}'/>
<span style="position:absolute; left:152mm;top:25mm" t-field="o.name" />
<span style="position:absolute; left:25mm;top:45mm" t-field="o.partner_id.display_name"/>
<span style="position:absolute; left:150mm;top:45mm" t-field="o.partner_id.document_number"/>
<span style="position:absolute; left:25mm;top:49mm" t-field="o.partner_id.street"/>
<span style="position:absolute; left:150mm;top:49mm" t-field="o.partner_id.city_id.name"/>
<div id="item_box" style="position:absolute; left:15mm;top:65mm">
<t t-as="line" t-foreach="chunk_lines">
<div>
<div style="left:15mm;display:inline-block;width:45mm;" t-field="line.product_uom_qty"/>
<div style="left:64mm;display:inline-block; width130mm; overflow:hidden;white-space: nowrap;" t-field="line.name"/>
</div>
</t>
</div>
<div style="width:160mm;position:absolute; left:25mm;top:130mm;height:10mm; overflow:hidden;" t-field="o.note"/>
</template>
<template id="report_preimpreso_pages">
<div class="page" style="zoom:1.25;font-size:0.8em;">
<div style="width:100%;height:148mm; position:absolute;">
<t t-call="ba_warehouse.report_preimpreso_internal"/>
</div>
<div style="width:100%; top:140mm;height:148mm;position:absolute;">
<t t-call="ba_warehouse.report_preimpreso_internal"/>
</div>
</div>
</template>
<template id="report_preimpreso">
<t t-call="report.html_container">
<t t-as="o" t-foreach="docs">
<t t-as="chunk_lines" t-foreach="[o.move_lines[i:i+15] for i in range(0,len(o.move_lines),15)]">
<t t-call="ba_warehouse.report_preimpreso_pages"/>
</t>
</t>
</t>
</template>
<report id="ba_report_preimpreso" model="stock.picking" name="ba_warehouse.report_preimpreso" report_type="qweb-pdf" string="Preimpreso"/>
<record id="ba_report_preimpreso" model="ir.actions.report.xml">
<field name="paperformat_id" ref="paperformat_preimpreso"/>
</record>
</data>
</openerp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment