<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2019 Akretion France (http://www.akretion.com/)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>


<record id="account_bank_statement_sale_form" model="ir.ui.view">
    <field name="name">account.bank.statement.sale.form</field>
    <field name="model">account.bank.statement.sale</field>
    <field name="arch" type="xml">
        <form string="Link to Quotation/Sale Orders">
            <group name="main" invisible="1">
                <field name="statement_id"/>
            </group>
            <group name="lines">
                <field name="line_ids" nolabel="1">
                    <tree editable="bottom">
                        <field name="move_line_id" invisible="1"/>
                        <field name="date"/>
                        <field name="name"/>
                        <field name="partner_id"/>
                        <field name="account_id"/>
                        <field name="credit"/>
                        <field name="sale_id" domain="['|', ('partner_id', 'child_of', partner_id), ('partner_invoice_id', 'child_of', partner_id), ('state', '!=', 'cancel'), ('invoice_status', '!=', 'invoiced')]"/>
                        <field name="company_currency_id" invisible="1"/>
                    </tree>
                </field>
            </group>
            <footer>
                <button name="validate" type="object" string="Validate" class="btn-primary"/>
                <button special="cancel" string="Cancel" class="btn-default"/>
            </footer>
        </form>
    </field>
</record>

<record id="account_bank_statement_sale_action" model="ir.actions.act_window">
    <field name="name">Link to Quotation/Sale Orders</field>
    <field name="res_model">account.bank.statement.sale</field>
    <field name="view_mode">form</field>
    <field name="target">new</field>
</record>


</odoo>
