<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2019-2021 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="view_order_form_inherit_sale_stock" model="ir.ui.view">
    <field name="name">sale.order.route.form</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
    <field name="arch" type="xml">
        <field name="partner_shipping_id" position="after">
            <field name="route_id" options="{'no_create_edit': True}"/>
        </field>
        <!-- propagate route_id to lines: it's important when you add an order line AFTER
        order confirmation -->
        <field name="order_line" position="attributes">
            <attribute name="context" operation="python_dict" key="default_route_id">route_id</attribute>
        </field>
    </field>
</record>

<record id="view_quotation_tree" model="ir.ui.view">
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale_stock.view_quotation_tree"/>
    <field name="arch" type="xml">
        <field name="warehouse_id" position="after">
            <field name="route_id" optional="hide"/>
        </field>
    </field>
</record>

<record id="view_order_tree" model="ir.ui.view">
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale_stock.view_order_tree"/>
    <field name="arch" type="xml">
        <field name="warehouse_id" position="after">
            <field name="route_id" optional="hide"/>
        </field>
    </field>
</record>


</odoo>
