mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
117 lines
5.4 KiB
XML
117 lines
5.4 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!-- Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
|
|
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"
|
|
role="alert"
|
|
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"
|
|
role="alert"
|
|
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"
|
|
role="alert"
|
|
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>
|
|
<xpath expr="//form/div[hasclass('oe_chatter')]" position="before">
|
|
<field
|
|
name="review_ids"
|
|
widget="tier_validation"
|
|
attrs="{'invisible':[('review_ids', '=', [])]}"
|
|
/>
|
|
</xpath>
|
|
</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 Stock Requests to review"
|
|
/>
|
|
<filter
|
|
name="tier_validated"
|
|
string="Validated"
|
|
domain="[('validated', '=', True)]"
|
|
help="Stock Requests validated and ready to be confirmed"
|
|
/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
</odoo>
|