[MIG] stock_usability from v14 to v16
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2015-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
|
||||
<menuitem id="procurement_scheduler_log_menu"
|
||||
action="procurement_scheduler_log_action"
|
||||
parent="stock.menu_stock_warehouse_mgmt" sequence="140"/>
|
||||
parent="stock.menu_warehouse_report" sequence="300"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 Akretion (http://www.akretion.com/)
|
||||
Copyright 2021-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
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">usability.stock.inventory.form</field>
|
||||
<field name="model">stock.inventory</field>
|
||||
<field name="inherit_id" ref="stock.view_inventory_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_open_inventory_lines" states="confirm" position="after">
|
||||
<button name="action_open_inventory_lines" states="done" string="Show Inventory Lines" type="object"/>
|
||||
</button>
|
||||
<field name="prefill_counted_quantity" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_inventory_line_tree" model="ir.ui.view">
|
||||
<field name="name">usability.stock.inventory.line.tree</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_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
<tree position="attributes">
|
||||
<!-- native :
|
||||
decoration-danger="product_qty != theoretical_qty"
|
||||
decoration-muted="product_qty == theoretical_qty"
|
||||
decoration-bf="is_editable"
|
||||
-->
|
||||
<attribute name="decoration-info">product_qty > theoretical_qty</attribute>
|
||||
<attribute name="decoration-danger">product_qty < theoretical_qty</attribute>
|
||||
</tree>
|
||||
<field name="location_id" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_inventory_line_search" model="ir.ui.view">
|
||||
<field name="name">usability.stock.inventory.line.search</field>
|
||||
<field name="model">stock.inventory.line</field>
|
||||
<field name="inherit_id" ref="stock.stock_inventory_line_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="categ_id"/>
|
||||
</field>
|
||||
<filter name="difference" position="after">
|
||||
<filter string="Difference = 0"
|
||||
name="counted_equal" domain="[('difference_qty', '=', 0)]"/>
|
||||
<filter string="Counted lower than Theoretical"
|
||||
name="counted_lower" domain="[('difference_qty', '<', 0)]"/>
|
||||
<filter string="Counted higher than Theoretical"
|
||||
name="counted_higher" domain="[('difference_qty', '>', 0)]"/>
|
||||
<separator/>
|
||||
<filter string="Counted" name="counted" domain="[('product_qty', '>', 0)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -52,6 +52,6 @@ should be able to access it. So I add a menu entry under Inventory Control. -->
|
||||
<menuitem id="stock_location_menu" action="stock.action_location_form"
|
||||
parent="stock.menu_warehouse_report"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
sequence="50"/>
|
||||
sequence="160"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</record>
|
||||
|
||||
<record id="view_production_lot_form" model="ir.ui.view">
|
||||
<field name="model">stock.production.lot</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_lot_open_quants" position="after">
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -22,7 +22,6 @@
|
||||
</field> -->
|
||||
<field name="origin" position="after">
|
||||
<field name="picking_id" readonly="1" string="Picking"/>
|
||||
<field name="inventory_id" readonly="1"/>
|
||||
</field>
|
||||
<group name="origin_grp" position="after">
|
||||
<group name="advanced" string="Advanced" groups="stock.group_stock_manager">
|
||||
@@ -38,20 +37,11 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- By default, stock.move have:
|
||||
_order = 'sequence, id'
|
||||
I don't know if they have a good reason to choose this order,
|
||||
but, when you open tree view of move lines from product, you want
|
||||
the most recent moves at the top, so we change the default
|
||||
order in the tree view (lower impact than changing _order -->
|
||||
<record id="view_move_tree" model="ir.ui.view">
|
||||
<field name="name">stock_usability.move.tree.better.order</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_move_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<tree position="attributes">
|
||||
<attribute name="default_order">date desc, picking_id, sequence</attribute>
|
||||
</tree>
|
||||
<field name="state" position="after">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
@@ -64,64 +54,4 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock.stock_move_action" model="ir.actions.act_window">
|
||||
<!-- Remove from context 'search_default_groupby_location_id': 1 -->
|
||||
<field name="context">{'search_default_done': 1}</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<field name="name">stock_usability.stock.move.line.tree</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_move_line_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="qty_done" position="before">
|
||||
<field name="product_qty" sum="1" string="Reserved Qty"/>
|
||||
</field>
|
||||
<field name="qty_done" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="state" position="after">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
states="partially_available,assigned"
|
||||
icon="fa-ban"/>
|
||||
</field>
|
||||
<field name="product_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- View embedded in picking -->
|
||||
<record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
<field name="qty_done" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="product_uom_qty" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_line_view_search" model="ir.ui.view">
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.stock_move_line_view_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="location_dest_id" position="after">
|
||||
<field name="lot_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock.stock_move_line_action" model="ir.actions.act_window">
|
||||
<!-- remove from context 'search_default_groupby_product_id': 1 -->
|
||||
<field name="context">{'search_default_done': 1, 'create': 0}</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
50
stock_usability/views/stock_move_line.xml
Normal file
50
stock_usability/views/stock_move_line.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<field name="name">stock_usability.stock.move.line.tree</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_move_line_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="qty_done" position="before">
|
||||
<field name="reserved_uom_qty" sum="1"/>
|
||||
</field>
|
||||
<field name="qty_done" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="state" position="after">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
states="partially_available,assigned"
|
||||
icon="fa-ban"/>
|
||||
</field>
|
||||
<field name="product_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- View embedded in picking -->
|
||||
<record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
<field name="qty_done" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="reserved_uom_qty" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -50,26 +50,15 @@
|
||||
<field name="location_id" groups="stock.group_stock_multi_locations" domain="[('id', 'child_of', 'parent.location_id')]" options="{'no_create': True}"/>
|
||||
<field name="location_dest_id" groups="stock.group_stock_multi_locations" domain="[('id', 'child_of', 'parent.location_dest_id')]" options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//sheet/group/group/field[@name='location_id']" position="attributes">
|
||||
<xpath expr="//sheet/group/group/field[@name='location_id' and @groups='stock.group_stock_multi_locations']" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//sheet/group/group/field[@name='location_dest_id']" position="attributes">
|
||||
<xpath expr="//sheet/group/group/field[@name='location_dest_id' and @groups='stock.group_stock_multi_locations']" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="vpicktree" model="ir.ui.view">
|
||||
<field name="name">stock_usability.view_picking_tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.vpicktree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_deadline" position="after">
|
||||
<field name="date_done" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_internal_search" model="ir.ui.view">
|
||||
<field name="name">stock_usability.view_picking_search</field>
|
||||
<field name="model">stock.picking</field>
|
||||
@@ -124,17 +113,4 @@
|
||||
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
|
||||
</record>
|
||||
|
||||
<record id="view_picking_type_tree" model="ir.ui.view">
|
||||
<field name="name">usability.stock.picking.type.tree</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="warehouse_id" position="after">
|
||||
<field name="default_location_src_id"/>
|
||||
<field name="default_location_dest_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
22
stock_usability/views/stock_picking_type.xml
Normal file
22
stock_usability/views/stock_picking_type.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_picking_type_tree" model="ir.ui.view">
|
||||
<field name="name">usability.stock.picking.type.tree</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="warehouse_id" position="after">
|
||||
<field name="default_location_src_id"/>
|
||||
<field name="default_location_dest_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -31,27 +31,40 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree_editable" model="ir.ui.view">
|
||||
<!-- view used from product form -->
|
||||
<record id="view_stock_quant_tree_inventory_editable" model="ir.ui.view">
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="available_quantity" position="before">
|
||||
<field name="quantity" position="after">
|
||||
<field name="reserved_quantity" sum="1" optional="show"/>
|
||||
<button type="object" name="action_stock_move_lines_reserved" string="Reservations" attrs="{'invisible': [('reserved_quantity', '=', 0)]}"/>
|
||||
<field name="available_quantity" position="move"/>
|
||||
</field>
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="inventory_quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="available_quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
<record id="view_stock_quant_tree_editable" model="ir.ui.view">
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="reserved_quantity" position="after">
|
||||
<button type="object" name="action_stock_move_lines_reserved" string="Reservations" attrs="{'invisible': [('reserved_quantity', '=', 0)]}"/>
|
||||
<field name="available_quantity" sum="1" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<!-- mig to v16 ?
|
||||
<record id="view_stock_quant_form" model="ir.ui.view">
|
||||
<field name="name">stock.usability.quant.form</field>
|
||||
<field name="model">stock.quant</field>
|
||||
@@ -69,6 +82,7 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<!-- more detailed stock.move tree view when using the button from product form -->
|
||||
<!-- TODO TEST
|
||||
@@ -76,18 +90,10 @@
|
||||
<field name="view_id" ref="stock.view_move_tree"/>
|
||||
</record> -->
|
||||
|
||||
<!-- The native menu entry of quants is called "Inventory Valuation"
|
||||
but it forces a group by on products that you can't remove
|
||||
So I create another "regular" Quants" menu entry -->
|
||||
<record id="stock_quant_action" model="ir.actions.act_window">
|
||||
<!-- Rename menu entry Locations -> Quants -->
|
||||
<record id="stock.menu_valuation" model="ir.ui.menu">
|
||||
<field name="name">Quants</field>
|
||||
<field name="res_model">stock.quant</field>
|
||||
<field name="view_mode">tree,form,pivot</field>
|
||||
<field name="context">{'search_default_internal_loc': 1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="stock_quant_menu" action="stock_quant_action"
|
||||
parent="stock.menu_warehouse_report"
|
||||
sequence="160"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -28,16 +28,5 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_warehouse_orderpoint_tree_editable_config" model="ir.ui.view">
|
||||
<field name="model">stock.warehouse.orderpoint</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable_config" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="trigger" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user