approval_wh_prep_move/views/approval_request_views.xml

52 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="approval_wh_prep_move_request_view_form_inherit" model="ir.ui.view">
<field name="name">approval.wh.prep.move.request.view.form.inherit</field>
<field name="model">approval.request</field>
<field name="inherit_id" ref="approvals.approval_request_view_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_get_attachment_view']" position="after">
<button name="action_open_wh_prep_move" type="object"
groups="stock.group_stock_user"
class="oe_stat_button" icon="fa-truck"
invisible="picking_count == 0">
<field name="picking_count" string="Transfers"
groups="stock.group_stock_user" widget="statinfo"/>
</button>
</xpath>
<xpath expr="//button[@name='action_confirm']" position="after">
<button name="action_create_wh_prep_move" type="object"
groups="stock.group_stock_user"
string="Create WH to Prep Move" class="btn-primary"
data-hotkey="g"
invisible="approval_type != 'wh_prep_move' or request_status != 'approved' or picking_count &gt; 0"/>
</xpath>
</field>
</record>
<record id="approval_wh_prep_move_request_view_tree_inherit" model="ir.ui.view">
<field name="name">approval.wh.prep.move.request.view.tree.inherit</field>
<field name="model">approval.request</field>
<field name="inherit_id" ref="approvals.approval_request_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='request_status']" position="attributes">
<attribute name="decoration-info">request_status == 'new' or request_status == 'wh_sent'</attribute>
<attribute name="decoration-warning">request_status == 'pending'</attribute>
<attribute name="decoration-success">request_status == 'approved'</attribute>
<attribute name="decoration-danger">request_status == 'refused'</attribute>
</xpath>
</field>
</record>
<record id="approval_wh_prep_move_request_view_form_inherit_statusbar" model="ir.ui.view">
<field name="name">approval.wh.prep.move.request.view.form.inherit.statusbar</field>
<field name="model">approval.request</field>
<field name="inherit_id" ref="approvals.approval_request_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='request_status']" position="attributes">
<attribute name="statusbar_visible">new,pending,approved,wh_sent,refused</attribute>
</xpath>
</field>
</record>
</odoo>