<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">

        <!-- Авансовый счёт (входящий) -->
        <record id="demo_prepaid_inbound_001" model="order.prepaid">
            <field name="name">АС-2026-001</field>
            <field name="partner_id" ref="demo_partner_invoice_1"/>
            <field name="invoice_date">2026-01-15</field>
            <field name="invoice_date_due">2026-01-30</field>
            <field name="company_id" ref="base.main_company"/>
            <field name="advance_type">inbound</field>
            <field name="state">draft</field>
        </record>

        <!-- Строки авансового счёта -->
        <record id="demo_prepaid_line_001" model="order.prepaid.line">
            <field name="prepaid_id" ref="demo_prepaid_inbound_001"/>
            <field name="product_id" model="product.product" search="[('product_tmpl_id', '=', ref('demo_product_tovar_tmpl'))]"/>
            <field name="label">Предоплата за товар</field>
            <field name="quantity">1.0</field>
            <field name="price_unit">150000.0</field>
        </record>
        <record id="demo_prepaid_line_002" model="order.prepaid.line">
            <field name="prepaid_id" ref="demo_prepaid_inbound_001"/>
            <field name="product_id" model="product.product" search="[('product_tmpl_id', '=', ref('demo_product_implementation_tmpl'))]"/>
            <field name="label">Предоплата за доставку</field>
            <field name="quantity">1.0</field>
            <field name="price_unit">5000.0</field>
        </record>

        <!-- Авансовый счёт (исходящий) -->
        <record id="demo_prepaid_outbound_001" model="order.prepaid">
            <field name="name">АС-2026-002</field>
            <field name="partner_id" ref="demo_partner_vendor_1"/>
            <field name="invoice_date">2026-01-20</field>
            <field name="invoice_date_due">2026-02-05</field>
            <field name="company_id" ref="base.main_company"/>
            <field name="advance_type">outbound</field>
            <field name="state">draft</field>
        </record>

        <record id="demo_prepaid_line_003" model="order.prepaid.line">
            <field name="prepaid_id" ref="demo_prepaid_outbound_001"/>
            <field name="product_id" model="product.product" search="[('product_tmpl_id', '=', ref('demo_product_server_tmpl'))]"/>
            <field name="label">Аванс поставщику за сырьё</field>
            <field name="quantity">10.0</field>
            <field name="price_unit">8000.0</field>
        </record>

</data>
</odoo>
