mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
72 lines
3.1 KiB
XML
72 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
<odoo>
|
|
<record id="view_inventory_form" model="ir.ui.view">
|
|
<field name="name">Inventory form view - discrepancy extension </field>
|
|
<field name="model">stock.inventory</field>
|
|
<field name="inherit_id" ref="stock.view_inventory_form" />
|
|
<field name="arch" type="xml">
|
|
<field name="state" position="attributes">
|
|
<attribute name="statusbar_visible">
|
|
draft,confirm,pending,done
|
|
</attribute>
|
|
<attribute name="statusbar_colors">
|
|
{"pending":"red"}
|
|
</attribute>
|
|
</field>
|
|
<xpath expr="//button[@name='action_validate']" position="attributes">
|
|
<attribute
|
|
name="groups"
|
|
>stock_inventory_discrepancy.group_stock_inventory_validation</attribute>
|
|
</xpath>
|
|
<xpath expr="//button[@name='action_validate']" position="after">
|
|
<button
|
|
name="action_force_done"
|
|
string="Force Validation"
|
|
type="object"
|
|
class="oe_highlight"
|
|
groups="stock_inventory_discrepancy.group_stock_inventory_validation_always"
|
|
attrs="{'invisible': ['|',('state', '!=', 'pending'),('over_discrepancy_line_count', '=', 0)]}"
|
|
/>
|
|
</xpath>
|
|
<xpath
|
|
expr="//button[@name='action_open_inventory_lines']"
|
|
position="attributes"
|
|
>
|
|
<attribute name="states">pending,confirm</attribute>
|
|
</xpath>
|
|
<xpath
|
|
expr="//button[@name='action_cancel_draft'][2]"
|
|
position="attributes"
|
|
>
|
|
<attribute name="states">pending,confirm</attribute>
|
|
</xpath>
|
|
<field name="company_id" position="before">
|
|
<field
|
|
name="over_discrepancy_line_count"
|
|
attrs="{'invisible': [('state', '!=', 'pending')]}"
|
|
/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
<record id="stock_inventory_line_tree2" model="ir.ui.view">
|
|
<field name="name">stock.inventory.line.tree2</field>
|
|
<field name="model">stock.inventory.line</field>
|
|
<field name="inherit_id" ref="stock.stock_inventory_line_tree" />
|
|
<field name="arch" type="xml">
|
|
<field name="product_qty" position="after">
|
|
<field name="discrepancy_qty" optional="show" />
|
|
<field name="discrepancy_percent" optional="show" />
|
|
<field name="discrepancy_threshold" optional="show" />
|
|
<field name="has_over_discrepancy" invisible="1" />
|
|
</field>
|
|
<xpath expr="//tree" position="attributes">
|
|
<attribute
|
|
name="decoration-danger"
|
|
>theoretical_qty < 0 or has_over_discrepancy</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</odoo>
|