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

    <!-- Создаём счета для профилей договоров если план счетов ещё не настроен -->
    <record id="demo_account_payable" model="account.account">
        <field name="name">Расчёты с поставщиками</field>
        <field name="code">60100</field>
        <field name="account_type">liability_payable</field>
        <field name="reconcile" eval="True"/>
        <field name="company_ids" eval="[(4, ref('base.main_company'))]"/>
    </record>

    <record id="demo_account_receivable" model="account.account">
        <field name="name">Расчёты с покупателями</field>
        <field name="code">62100</field>
        <field name="account_type">asset_receivable</field>
        <field name="reconcile" eval="True"/>
        <field name="company_ids" eval="[(4, ref('base.main_company'))]"/>
    </record>

    <!-- Виды договоров -->
    <record id="demo_contract_profile_supply" model="contract.profile">
        <field name="name">Договор поставки</field>
        <field name="payable_account_id" ref="demo_account_payable"/>
        <field name="receivable_account_id" ref="demo_account_receivable"/>
        <field name="max_receivable_id">0</field>
        <field name="payment_term_id" ref="account.account_payment_term_immediate"/>
        <field name="journal_id" model="account.journal"
               search="[('type', '=', 'sale'), ('company_id', '=', obj().env.ref('base.main_company').id)]"/>
    </record>

    <record id="demo_contract_profile_service" model="contract.profile">
        <field name="name">Договор оказания услуг</field>
        <field name="payable_account_id" ref="demo_account_payable"/>
        <field name="receivable_account_id" ref="demo_account_receivable"/>
        <field name="max_receivable_id">0</field>
        <field name="payment_term_id" ref="account.account_payment_term_immediate"/>
        <field name="journal_id" model="account.journal"
               search="[('type', '=', 'sale'), ('company_id', '=', obj().env.ref('base.main_company').id)]"/>
    </record>

    <record id="demo_contract_profile_agency" model="contract.profile">
        <field name="name">Агентский договор</field>
        <field name="payable_account_id" ref="demo_account_payable"/>
        <field name="receivable_account_id" ref="demo_account_receivable"/>
        <field name="max_receivable_id">0</field>
        <field name="payment_term_id" ref="account.account_payment_term_immediate"/>
        <field name="journal_id" model="account.journal"
               search="[('type', '=', 'sale'), ('company_id', '=', obj().env.ref('base.main_company').id)]"/>
    </record>

    <!-- Дни доставки/отгрузки -->
    <record id="demo_day_monday" model="contract.day">
        <field name="name">Понедельник</field>
    </record>
    <record id="demo_day_wednesday" model="contract.day">
        <field name="name">Среда</field>
    </record>
    <record id="demo_day_friday" model="contract.day">
        <field name="name">Пятница</field>
    </record>

</data>
</odoo>
