<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Paper Format para el reporte de resultados -->
    <record id="paperformat_lab_results" model="report.paperformat">
        <field name="name">Formato Resultados de Laboratorio</field>
        <field name="format">A4</field>
        <field name="orientation">Portrait</field>
        <field name="margin_top">40</field>
        <field name="margin_bottom">25</field>
        <field name="margin_left">10</field>
        <field name="margin_right">10</field>
        <field name="header_spacing">35</field>
        <field name="dpi">90</field>
    </record>

    <!-- Acción del reporte -->
    <record id="action_report_lab_results" model="ir.actions.report">
        <field name="name">Informe de Resultados</field>
        <field name="model">sale.order</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">lims_management.report_lab_results</field>
        <field name="report_file">lims_management.report_lab_results</field>
        <field name="print_report_name">'Resultados_Lab_' + object.name + '.pdf'</field>
        <field name="paperformat_id" ref="paperformat_lab_results"/>
        <field name="attachment">'Resultados_Lab_' + object.name + '.pdf'</field>
        <field name="attachment_use">True</field>
        <field name="binding_model_id" ref="sale.model_sale_order"/>
        <field name="binding_type">report</field>
    </record>
</odoo>