<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 ForgeFlow S.L.
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_purchase_order_filter" model="ir.ui.view">
        <field name="name">purchase.order.select - purchase_tier_validation</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.view_purchase_order_filter" />
        <field name="arch" type="xml">
            <filter name="order_date" position="after">
                <separator />
                <filter
                    name="needs_review"
                    string="Needs my Review"
                    domain="[('reviewer_ids','in',uid), ('state', 'not in', ['done', 'cancel','to approve'])]"
                    help="My Purchases to review"
                />
                <filter
                    name="tier_validated"
                    string="Validated"
                    domain="[('validation_status', '=', 'validated')]"
                    help="POs validated and ready to be confirmed"
                />
            </filter>
        </field>
    </record>
    <record id="purchase_order_kpis_tree" model="ir.ui.view">
        <field name="name">purchase.order.inherit.purchase.order.tree</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_kpis_tree" />
        <field name="arch" type="xml">
            <tree position="inside">
                <field
                    name="validation_status"
                    widget="badge"
                    optional="hide"
                    decoration-info="validation_status == 'pending'"
                    decoration-danger="validation_status == 'rejected'"
                    decoration-success="validation_status == 'validated'"
                />
            </tree>
        </field>
    </record>
</odoo>
