<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017-2020 Onestein (<http://www.onestein.eu>)
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="sale_order_archive_form_view" model="ir.ui.view">
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="after">
                <widget
                    name="web_ribbon"
                    title="Archived"
                    bg_color="bg-danger"
                    invisible="active"
                />
            </xpath>
            <xpath expr="//button[@name='action_draft']" position="attributes">
                <attribute
                    name="invisible"
                >state != 'cancel' or active != True</attribute>
            </xpath>
            <xpath expr="//sheet">
                <field name="active" invisible="1" />
            </xpath>
        </field>
    </record>
    <record id="sale_order_archive_search_view" model="ir.ui.view">
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_sales_order_filter" />
        <field name="arch" type="xml">
            <xpath expr="//search" position="inside">
                <separator />
                <filter
                    string="Archived"
                    name="inactive"
                    domain="[('active','=',False)]"
                />
            </xpath>
        </field>
    </record>
</odoo>
