<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017-2020 Onestein (<https://www.onestein.eu>)
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="purchase_order_archive_form" model="ir.ui.view">
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_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"
                    attrs="{'invisible': [('active', '=', True)]}"
                />
            </xpath>
            <xpath expr="//sheet">
                <field name="active" invisible="1" />
            </xpath>
        </field>
    </record>
    <record id="view_purchase_order_archive_filter" model="ir.ui.view">
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.view_purchase_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>
