diff options
Diffstat (limited to 'addons/stock/views/stock_inventory_views.xml')
| -rw-r--r-- | addons/stock/views/stock_inventory_views.xml | 258 |
1 files changed, 258 insertions, 0 deletions
diff --git a/addons/stock/views/stock_inventory_views.xml b/addons/stock/views/stock_inventory_views.xml new file mode 100644 index 00000000..f4d9eda9 --- /dev/null +++ b/addons/stock/views/stock_inventory_views.xml @@ -0,0 +1,258 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="stock_inventory_line_tree" model="ir.ui.view"> + <field name="name">stock.inventory.line.tree</field> + <field name="model">stock.inventory.line</field> + <field name="arch" type="xml"> + <tree default_order="location_id,product_id" editable="top" string="Inventory Details" js_class="inventory_validate_button" + decoration-danger="product_qty != theoretical_qty" + decoration-muted="product_qty == theoretical_qty" + decoration-bf="is_editable"> + <field name="company_id" invisible="1"/> + <field name="product_tracking" invisible="1"/> + <field name="is_editable" invisible="1"/> + <field name="outdated" invisible="1"/> + <field name="product_id" width="1.6" + context="{'default_type': 'product'}" + readonly="context.get('default_product_id', False)" + attrs="{'readonly': ['|', + ('is_editable', '=', False), + ('state', '!=', 'confirm')]}"/> + <field name="location_id" groups="stock.group_stock_multi_locations" + options="{'no_create': True}" + invisible="context.get('readonly_location_id', False)" + readonly="context.get('readonly_location_id', False)" + attrs="{'readonly': ['|', + ('is_editable', '=', False), + ('state', '!=', 'confirm')]}"/> + <field name="inventory_date" optional="hide" width="0.8"/> + <field name="prod_lot_id" groups="stock.group_production_lot" width="0.8" + attrs="{'readonly': ['|', '|', + ('product_tracking', '=', 'none'), + ('is_editable', '=', False), + ('state', '!=', 'confirm')]}" + context="{'default_product_id': product_id, 'default_company_id': company_id}" optional="show"/> + <field name="package_id" groups="stock.group_tracking_lot" width="0.8" + attrs="{'readonly': ['|', + ('is_editable', '=', False), + ('state', '!=', 'confirm')]}" + string="Package" optional="show"/> + <field name="partner_id" groups="stock.group_tracking_owner" + attrs="{'readonly': ['|', + ('is_editable', '=', False), + ('state', '!=', 'confirm')]}"/> + <field name="theoretical_qty" string="On Hand" width="0.5" + force_save="1" readonly="1" optional="show"/> + <button name="action_refresh_quantity" title="Refresh quantity" + icon="fa-refresh" type="object" + attrs="{'invisible': [('outdated', '=', False)]}"/> + <field name="product_qty" width="0.5" string="Counted"/> + <field name="difference_qty" optional="show" width="0.5"/> + <field name="product_uom_id" string="UoM" groups="uom.group_uom" + width="0.3" force_save="1"/> + <field name="inventory_id" invisible="1"/> + <field name="state" invisible="1"/> + </tree> + </field> + </record> + + <record id="stock_inventory_line_tree_no_product_create" 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="mode">primary</field> + <field name="priority">1000</field> + <field name="arch" type="xml"> + <field name="product_id" position="attributes"><attribute name="options">{'no_create': True}</attribute></field> + </field> + </record> + + <record id="stock_inventory_line_search" model="ir.ui.view"> + <field name="name">stock.inventory.line.search</field> + <field name="model">stock.inventory.line</field> + <field name="arch" type="xml"> + <search string="Search Inventory Lines"> + <field name="product_id"/> + <field name="location_id" groups="stock.group_stock_multi_locations"/> + <field name="prod_lot_id" groups="stock.group_production_lot"/> + <field name="package_id" groups="stock.group_tracking_lot"/> + <field name="partner_id" groups="stock.group_tracking_owner"/> + <filter string="Outdated Theoretical Quantities" + name="outdated" domain="[('outdated', '=', True)]"/> + <filter string="Difference different than zero" + name="difference" domain="[('difference_qty', '!=', '0')]"/> + <group expand='0' string='Group by...'> + <filter string='Location' name="location" domain="[]" context="{'group_by' : 'location_id'}"/> + <filter string='Packaging' name="packaging" domain="[]" context="{'group_by' : 'package_id'}"/> + <filter string='Product' name="product" domain="[]" context="{'group_by' : 'product_id'}"/> + <filter string='Product Category' name="product_category" domain="[]" context="{'group_by' : 'categ_id'}"/> + </group> + </search> + </field> + </record> + + <record id="view_inventory_filter" model="ir.ui.view"> + <field name="name">stock.inventory.filter</field> + <field name="model">stock.inventory</field> + <field name="arch" type="xml"> + <search string="Search Inventory"> + <field name="name" string="Reference"/> + <field name="product_ids" string="Product" filter_domain="['|', ('product_ids', 'ilike', self), ('line_ids.product_id','ilike',self)]"/> + <filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/> + <filter string="In Progress" name="confirm" domain="[('state', '=', 'confirm')]"/> + <filter string="Validated" name="done" domain="[('state', '=', 'done')]"/> + <separator/> + <filter string="Inventory Date" name="inventory_date" date="date"/> + <group expand="0" string="Group By"> + <filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/> + <filter string="Inventory Date" name="inventories_month" domain="[]" context="{'group_by': 'date'}" help="Physical Inventories by Date"/> + </group> + </search> + </field> + </record> + + <record id="view_inventory_tree" model="ir.ui.view"> + <field name="name">stock.inventory.tree</field> + <field name="model">stock.inventory</field> + <field name="arch" type="xml"> + <tree string="Lot/Serial Number Inventory" sample="1"> + <field name="date"/> + <field name="name"/> + <field name="location_ids" widget="many2many_tags" optional="hide" groups="stock.group_stock_multi_locations"/> + <field name="product_ids" widget="many2many_tags" optional="hide"/> + <field name="company_id" groups="base.group_multi_company" optional="show"/> + <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state in ('draft', 'confirm')"/> + </tree> + </field> + </record> + + <record id="view_stock_inventory_kanban" model="ir.ui.view"> + <field name="name">stock.inventory.kanban</field> + <field name="model">stock.inventory</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile" sample="1"> + <field name="name"/> + <field name="date"/> + <field name="state"/> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_global_click"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"><span><t t-esc="record.name.value"/></span></strong> + </div> + <field name="state" widget="label_selection" options="{'classes': {'draft': 'info', 'cancel': 'default', 'confirm': 'success', 'done': 'success'}}"/> + </div> + <div class="o_kanban_record_bottom"> + <div class="oe_kanban_bottom_left"> + </div> + <div class="oe_kanban_bottom_right"> + <field name="date" widget="date"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="view_inventory_form" model="ir.ui.view"> + <field name="name">stock.inventory.form</field> + <field name="model">stock.inventory</field> + <field name="arch" type="xml"> + <form string="Inventory Adjustment"> + <header> + <button name="action_start" states="draft" string="Start Inventory" type="object" class="oe_highlight" groups="stock.group_stock_user"/> + <button name="action_open_inventory_lines" states="confirm" string="Continue Inventory" type="object" class="oe_highlight" groups="stock.group_stock_user"/> + <button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '!=', [])]}" groups="stock.group_stock_manager"/> + <button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '=', [])]}" class="oe_highlight" groups="stock.group_stock_manager"/> + <button name="action_print" string="Print Count Sheet" type="object" attrs="{'invisible': [('state', '=', 'draft')]}" groups="stock.group_stock_user"/> + <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/> + <button name="action_cancel_draft" states="confirm" string="Cancel Inventory" type="object" + confirm="If you cancel this inventory adjustment, all its inventory adjustment lines will be lost. Are you sure you want to discard it ?"/> + <field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/> + </header> + <sheet> + <field name="line_ids" invisible="1"/> + <div class="oe_button_box" name="button_box"> + <button string="Product Moves" type="object" + name="action_view_related_move_lines" + class="oe_stat_button" icon="fa-exchange" + attrs="{'invisible': [('state', '!=', 'done')]}" + context="{'no_reference': True}"/> + </div> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1><field name="name" placeholder="e.g. Annual inventory"/></h1> + </div> + <group> + <group> + <field name="location_ids" options="{'no_create': True}" + widget="many2many_tags" + force_save="1" + groups="stock.group_stock_multi_locations"/> + <field name="product_ids" + context="{'default_type': 'product'}" + widget="many2many_tags"/> + <field name="exhausted"/> + </group> + <group> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + <field name="prefill_counted_quantity" widget="radio" + attrs="{'invisible': [('state', '!=', 'draft')]}"/> + </group> + </group> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="activity_ids" widget="mail_activity"/> + <field name="message_ids" widget="mail_thread"/> + </div> + </form> + </field> + </record> + + <record id="action_inventory_form" model="ir.actions.act_window"> + <field name="name">Inventory Adjustments</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">stock.inventory</field> + <field name="view_mode">tree,kanban,form</field> + <field name="view_id" ref="view_inventory_tree"/> + <field name="search_view_id" ref="view_inventory_filter"/> + <field name="help" type="html"> + <p class="o_view_nocontent_barcode_scanner"> + Want to speed up your inventory counts? Try our Barcode app + </p><p> + Barcode scanner can be activated via inventory settings. + Manual inventory adjustments can also be performed and pre-filled with + suggested counted quantity. + </p> + </field> + </record> + + <record id="model_stock_inventory_line_action_reset_product_qty" model="ir.actions.server"> + <field name="name">Set counted quantities to 0</field> + <field name="model_id" ref="model_stock_inventory_line"/> + <field name="binding_model_id" ref="model_stock_inventory_line"/> + <field name="state">code</field> + <field name="code"> +if records: + action = records.action_reset_product_qty() + </field> + </record> + + <record id="model_stock_inventory_line_action_recompute_quantity" model="ir.actions.server"> + <field name="name">Recompute On Hand Quantity</field> + <field name="model_id" ref="model_stock_inventory_line"/> + <field name="binding_model_id" ref="model_stock_inventory_line"/> + <field name="state">code</field> + <field name="code"> +if records: + action = records.action_refresh_quantity() + </field> + </record> + + <menuitem action="action_inventory_form" id="menu_action_inventory_form" parent="menu_stock_warehouse_mgmt" sequence="30"/> +</odoo> |
