<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2016-2022 Akretion (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="view_order_tree" model="ir.ui.view">
    <field name="name">quotation_title.sale_order_tree</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_tree"/>
    <field name="arch" type="xml">
        <field name="user_id" position="before">
            <field name="quotation_title" optional="show"/>
        </field>
    </field>
</record>

<record id="view_quotation_tree" model="ir.ui.view">
    <field name="name">quotation_title.quotation_tree</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_quotation_tree"/>
    <field name="arch" type="xml">
        <field name="user_id" position="before">
            <field name="quotation_title" optional="show"/>
        </field>
    </field>
</record>

<record id="view_order_form" model="ir.ui.view">
    <field name="name">quotation_title.sale_order_form</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_form"/>
    <field name="arch" type="xml">
        <field name="name" position="attributes">
            <attribute name="class">oe_inline</attribute>
        </field>
        <xpath expr="//field[@name='name']" position="after"> - 
            <field name="quotation_title" class="oe_inline" placeholder="Title of the quotation"/>
        </xpath>
    </field>
</record>

<record id="view_sales_order_filter" model="ir.ui.view">
    <field name="name">quotation_title.sale_order_search</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_sales_order_filter"/>
    <field name="arch" type="xml">
        <field name="name" position="attributes">
            <attribute name="filter_domain">['|', '|', '|', ('name', 'ilike', self), ('client_order_ref', 'ilike', self), ('partner_id', 'child_of', self), ('quotation_title', 'ilike', self)]</attribute>
        </field>
    </field>
</record>

</odoo>
