<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <record id="account_loans_loan_demo_file_csv" model="ir.attachment">
            <field name="name">loan_amortization_demo.csv</field>
            <field name="datas" type="base64" file="account_loans/demo/files/loan_amortization_demo.csv"/>
        </record>

        <record id="account_loans_loan_demo_file_xlsx" model="ir.attachment">
            <field name="name">loan_amortization_demo.xlsx</field>
            <field name="datas" type="base64" file="account_loans/demo/files/loan_amortization_demo.xlsx"/>
        </record>

        <record id="account_loans_journal_loan" model="account.journal">
            <field name="name">Journal Loan Demo</field>
            <field name="type">general</field>
            <field name="code">LOAN</field>
        </record>

        <record id="account_loans_loan_demo1" model="account.loan">
<!--            Used in the __init__.py -> _account_loans_post_init-->
            <field name="name">Loan Demo 1</field>
            <field name="asset_group_id" ref="odex30_account_asset.account_asset_group_demo"/>
            <field name="journal_id" ref="account_loans.account_loans_journal_loan"/>
            <field name="long_term_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'liability_non_current'),
            ]"/>
            <field name="short_term_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'liability_current'),
            ]"/>
            <field name="expense_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'expense'),
                ('id', '!=', obj().env.user.company_id.account_journal_early_pay_discount_loss_account_id.id),
            ]"/>
        </record>

        <record id="account_loans_loan_demo2" model="account.loan">
<!--            Used in the __init__.py -> _account_loans_post_init-->
            <field name="name">Loan Demo 2</field>
            <field name="asset_group_id" ref="odex30_account_asset.account_asset_group_demo"/>
            <field name="journal_id" ref="account_loans.account_loans_journal_loan"/>
            <field name="long_term_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'liability_non_current'),
            ]"/>
            <field name="short_term_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'liability_current'),
            ]"/>
            <field name="expense_account_id" model="account.account" search="[
                ('company_ids', '=', ref('base.main_company')),
                ('account_type', '=', 'expense'),
                ('id', '!=', obj().env.user.company_id.account_journal_early_pay_discount_loss_account_id.id),
            ]"/>
        </record>

    </data>
</odoo>
