<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 Tecnativa - Carlos Roca -->
<odoo>
    <record id="view_order_form" model="ir.ui.view">
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">
            <field name="payment_term_id" position="after">
                <!-- Security group sale_stock.group_route_so_lines
                     disappear  in v13. So we use the same group that route_id
                     field in sale order lines.
                 -->
                <field
                    name="route_id"
                    attrs="{'readonly': [('state', 'in', ('sale', 'done', 'cancel'))]}"
                    groups="stock.group_adv_location"
                />
            </field>
        </field>
    </record>
</odoo>
