add purchase_price_review_status

This commit is contained in:
Luis 2026-04-02 12:43:36 +02:00
parent d9a0eeb878
commit f586c99df9
10 changed files with 260 additions and 0 deletions

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="purchase_order_form_price_review" model="ir.ui.view">
<field name="name">purchase.order.form.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_ref']" position="after">
<field name="prices_reviewed" />
</xpath>
</field>
</record>
<record id="purchase_order_view_tree_price_review" model="ir.ui.view">
<field name="name">purchase.order.view.tree.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_view_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-success">receipt_status != 'full' and prices_reviewed</attribute>
<attribute name="decoration-danger">receipt_status != 'full' and not prices_reviewed</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="prices_reviewed" optional="hide" />
<field name="receipt_status" invisible="1" />
</xpath>
</field>
</record>
<record id="purchase_order_tree_price_review" model="ir.ui.view">
<field name="name">purchase.order.tree.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-success">receipt_status != 'full' and prices_reviewed</attribute>
<attribute name="decoration-danger">receipt_status != 'full' and not prices_reviewed</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="prices_reviewed" optional="hide" />
<field name="receipt_status" invisible="1" />
</xpath>
</field>
</record>
<record id="purchase_order_kpis_tree_price_review" model="ir.ui.view">
<field name="name">purchase.order.kpis.tree.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_kpis_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-success">receipt_status != 'full' and prices_reviewed</attribute>
<attribute name="decoration-danger">receipt_status != 'full' and not prices_reviewed</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="prices_reviewed" optional="hide" />
<field name="receipt_status" invisible="1" />
</xpath>
</field>
</record>
<record id="view_purchase_order_filter_price_review" model="ir.ui.view">
<field name="name">purchase.order.filter.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.view_purchase_order_filter" />
<field name="arch" type="xml">
<xpath expr="//filter[@name='starred']" position="after">
<filter
name="prices_not_reviewed"
string="Prices Not Reviewed"
domain="[('prices_reviewed', '=', False)]"
/>
</xpath>
</field>
</record>
<record id="purchase_order_view_search_price_review" model="ir.ui.view">
<field name="name">purchase.order.view.search.price.review</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_view_search" />
<field name="arch" type="xml">
<xpath expr="//filter[@name='starred']" position="after">
<filter
name="prices_not_reviewed"
string="Prices Not Reviewed"
domain="[('prices_reviewed', '=', False)]"
/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="stock_picking_tree_price_review" model="ir.ui.view">
<field name="name">stock.picking.tree.price.review</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-success">picking_type_code == 'incoming' and state not in ('done', 'cancel') and purchase_id and purchase_prices_reviewed</attribute>
<attribute name="decoration-danger">picking_type_code == 'incoming' and state not in ('done', 'cancel') and purchase_id and not purchase_prices_reviewed</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="purchase_id" invisible="1" />
<field name="purchase_prices_reviewed" optional="hide" />
</xpath>
</field>
</record>
<record id="view_picking_internal_search_price_review" model="ir.ui.view">
<field name="name">stock.picking.internal.search.price.review</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search" />
<field name="arch" type="xml">
<xpath expr="//filter[@name='starred']" position="after">
<filter
name="purchase_prices_not_reviewed"
string="Purchase Prices Not Reviewed"
domain="[
('picking_type_code', '=', 'incoming'),
('purchase_id', '!=', False),
('purchase_id.prices_reviewed', '=', False)
]"
/>
</xpath>
</field>
</record>
</odoo>