mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
118 lines
6.1 KiB
XML
118 lines
6.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright 2019 Eficent Business and IT Consulting Services S.L.
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
<odoo>
|
|
|
|
<record id="view_stock_request_form_inherit_tier" model="ir.ui.view">
|
|
<field name="name">stock.request.tier.validation.form</field>
|
|
<field name="model">stock.request</field>
|
|
<field name="inherit_id" ref="stock_request.view_stock_request_form"/>
|
|
<field name="arch" type="xml">
|
|
<button name="action_confirm" position="attributes">
|
|
<attribute name="attrs">{'invisible': ['|','&',('validated', '!=', True),('need_validation', '=', True),'|',('need_validation', '=', True),('state', 'not in', ['draft'])]}</attribute>
|
|
<attribute name="groups">stock_request.group_stock_request_manager</attribute>
|
|
</button>
|
|
<button name="action_confirm" position="before">
|
|
<button name="request_validation"
|
|
string="Request Validation"
|
|
attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('state','not in',['draft','sent'])]}"
|
|
type="object"/>
|
|
<button name="restart_validation"
|
|
string="Restart Validation"
|
|
attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['draft','sent'])]}"
|
|
type="object"/>
|
|
</button>
|
|
<header position="after">
|
|
<field name="need_validation" invisible="1"/>
|
|
<field name="validated" invisible="1"/>
|
|
<field name="rejected" invisible="1"/>
|
|
<div class="alert alert-warning"
|
|
attrs="{'invisible': ['|', '|', '|',
|
|
('validated', '=', True), ('state', 'not in', ['draft','sent']),
|
|
('rejected', '=', True), ('review_ids', '=', [])]}"
|
|
style="margin-bottom:0px;">
|
|
<p><i class="fa fa-info-circle"/>This Stock Request needs to be
|
|
validated.
|
|
<field name="can_review" invisible="1"/>
|
|
<button name="validate_tier"
|
|
string="Validate"
|
|
attrs="{'invisible': [('can_review', '=', False)]}"
|
|
type="object"
|
|
class="oe_inline oe_button btn-success"
|
|
icon="fa-thumbs-up"/>
|
|
<button name="reject_tier"
|
|
string="Reject"
|
|
attrs="{'invisible': [('can_review', '=', False)]}"
|
|
type="object"
|
|
class="btn-icon btn-danger"
|
|
icon="fa-thumbs-down"/>
|
|
</p>
|
|
</div>
|
|
<div class="alert alert-success"
|
|
attrs="{'invisible': ['|', '|', ('validated', '!=', True), ('state', 'not in', ['draft','sent']), ('review_ids', '=', [])]}"
|
|
style="margin-bottom:0px;">
|
|
<p><i class="fa fa-thumbs-up"/> Operation has been <b>validated</b>!</p>
|
|
</div>
|
|
<div class="alert alert-danger"
|
|
attrs="{'invisible': ['|', '|', ('rejected', '!=', True), ('state', 'not in', ['draft','sent']), ('review_ids', '=', [])]}"
|
|
style="margin-bottom:0px;">
|
|
<p><i class="fa fa-thumbs-down"/> Operation has been <b>rejected</b>.</p>
|
|
</div>
|
|
</header>
|
|
<div name="button_box" position="inside">
|
|
<field name="review_ids" widget="review_popup" attrs="{'invisible':[('review_ids', '=', [])]}"/>
|
|
</div>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_stock_request_filter" model="ir.ui.view">
|
|
<field name="name">stock.request.select - stock_request_tier_validation</field>
|
|
<field name="model">stock.request</field>
|
|
<field name="inherit_id" ref="stock_request.stock_request_search"/>
|
|
<field name="arch" type="xml">
|
|
<search position="inside">
|
|
<group expand="0" string="Need actions">
|
|
<filter name="needs_review" string="Needs my Review"
|
|
domain="[('reviewer_ids','in',uid), ('state', 'not in', ['done', 'cancel'])]"
|
|
help="My Purchases to review"/>
|
|
<filter name="tier_validated" string="Validated"
|
|
domain="[('validated', '=', True)]"
|
|
help="Stock Requests validated and ready to be confirmed"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="tier_review_form_wiz" model="ir.ui.view">
|
|
<field name="name">stock.request.order.reviews</field>
|
|
<field name="model">stock.request.order</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Tier Review">
|
|
<group>
|
|
<field name="review_ids" nolabel="1" readonly="1">
|
|
<tree create="false"
|
|
decoration-danger="status=='rejected'"
|
|
decoration-warning="status=='pending'"
|
|
decoration-success="status=='approved'">
|
|
<field name="sequence"/>
|
|
<field name="requested_by"/>
|
|
<field name="review_type"/>
|
|
<field name="name"/>
|
|
<field name="status"/>
|
|
<field name="done_by"/>
|
|
</tree>
|
|
</field>
|
|
</group>
|
|
<footer>
|
|
<button name="dismiss_popup"
|
|
type="object"
|
|
string="Dismiss"
|
|
class="oe_highlight"
|
|
/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|