[MIG] stock_usability to v14

This commit is contained in:
Alexis de Lattre
2020-12-03 00:17:57 +01:00
parent f818bb5895
commit e060de7efc
26 changed files with 664 additions and 700 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015-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="procurement_group_form_view" model="ir.ui.view">
<field name="name">stock_usability.procurement.group.form</field>
<field name="model">procurement.group</field>
<field name="inherit_id" ref="stock.procurement_group_form_view"/>
<field name="arch" type="xml">
<field name="move_type" position="after">
<field name="partner_id" readonly="1"/>
</field>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015-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="procurement_scheduler_log_tree" model="ir.ui.view">
<field name="name">procurement_scheduler_log_tree</field>
<field name="model">procurement.scheduler.log</field>
<field name="arch" type="xml">
<tree string="Procurement Scheduler Logs">
<field name="start_datetime"/>
<field name="create_date" string="Scheduler End Time"/>
<field name="create_uid" string="Scheduler Executed by"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="procurement_scheduler_log_action" model="ir.actions.act_window">
<field name="name">Scheduler Logs</field>
<field name="res_model">procurement.scheduler.log</field>
<field name="view_mode">tree</field>
</record>
<menuitem id="procurement_scheduler_log_menu"
action="procurement_scheduler_log_action"
parent="stock.menu_stock_warehouse_mgmt" sequence="140"/>
</odoo>

View File

@@ -0,0 +1,39 @@
<?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="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">
<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 &gt; theoretical_qty</attribute>
<attribute name="decoration-danger">product_qty &lt; theoretical_qty</attribute>
</tree>
</field>
</record>
<record id="view_inventory_tree" model="ir.ui.view">
<field name="name">usability.stock.inventory.tree</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_tree"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-info">state == 'draft'</attribute>
<attribute name="decoration-warning">state == 'confirm'</attribute>
</tree>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,57 @@
<?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_location_search" model="ir.ui.view">
<field name="name">stock.usability.stock.location.search</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_search" />
<field name="arch" type="xml">
<filter name="inactive" position="after">
<group string="Group By" name="groupby">
<filter name="usage_groupby" string="Location Type"
context="{'group_by': 'usage'}"/>
<filter name="removal_strategy_groupby" string="Removal Strategy"
context="{'group_by': 'removal_strategy_id'}"/>
</group>
</filter>
</field>
</record>
<record id="location_open_orderpoint" model="ir.actions.act_window">
<field name="name">Reordering Rules</field>
<field name="res_model">stock.warehouse.orderpoint</field>
<field name="context">{'default_location_id': active_id, 'search_default_location_id': active_id}</field>
</record>
<record id="view_location_form" model="ir.ui.view">
<field name="name">stock.usability.stock.location.form</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button type="action" name="%(location_open_orderpoint)d"
string="Reordering Rules"
class="oe_stat_button" icon="fa-refresh"/>
</div>
</field>
</record>
<!-- By default, the menu entry for stock location is only under
Configuration > Warehouse management
But, the view of stock location is very useful to be able to list
of the items present on a particular stock location => so every user
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"/>
</odoo>

View File

@@ -0,0 +1,84 @@
<?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>
<!-- Display advanced fields in stock moves form view -->
<record id="view_move_form" model="ir.ui.view">
<field name="name">stock.usability.stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<!--
<field name="state" position="before">
<button type="object" name="button_do_unreserve" string="Unreserve"
groups="stock.group_stock_user"
attrs="{'invisible': [('reserved_quant_ids', '=', [])]}"/>
</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">
<field name="warehouse_id" readonly="1"/>
<field name="route_ids" widget="many2many_tags" readonly="1"/>
<field name="rule_id" readonly="1"/>
<field name="propagate_cancel" readonly="1"/>
<field name="price_unit" readonly="1"/>
<field name="partner_id" readonly="1"/>
<field name="restrict_partner_id" readonly="1"/>
</group>
</group>
</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"
states="partially_available,assigned"
icon="fa-ban"/>
</field>
</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>
</record>
</odoo>

View File

@@ -0,0 +1,133 @@
<?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_picking_form" model="ir.ui.view">
<field name="name">stock_usability.view_picking_form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="backorder_id" position="attributes">
<attribute name="attrs">{}</attribute>
</field>
<field name="partner_id" position="attributes">
<attribute name="context">{'show_address': 1}</attribute>
<attribute name="options">{'always_reload': True}</attribute>
</field>
<button name="action_cancel" type="object" position="attributes">
<attribute name="confirm">Are you sure you want to cancel this picking?</attribute>
</button>
<!-- STOCK MOVE -->
<!-- This sum is useful to check the 'number of items' to transfer... -->
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_uom_qty']" position="attributes">
<attribute name="sum">1</attribute>
</xpath>
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_id']" position="replace"/>
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_dest_id']" position="replace"/>
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="after">
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
</xpath>
<xpath expr="//field[@name='move_ids_without_package']/tree/button[@name='action_assign_serial']" position="after">
<button type="object" name="button_do_unreserve" string="Unreserve"
groups="stock.group_stock_user"
states="partially_available,assigned"
icon="fa-ban"/>
</xpath>
<!-- STOCK MOVE LINE -->
<!--
<xpath expr="//field[@name='move_line_ids_without_package']/tree/field[@name='location_id']" position="attributes">
<attribute name="attrs">{}</attribute>
</xpath>
<xpath expr="//field[@name='move_line_ids_without_package']/tree/field[@name='location_dest_id']" 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>
<field name="inherit_id" ref="stock.view_picking_internal_search" />
<field name="arch" type="xml">
<filter name="picking_type" position="after">
<filter string="Partner" name="partner_groupby" context="{'group_by': 'partner_id'}"/>
</filter>
<filter name="origin" position="replace"/>
<filter name="expected_date" position="after">
<filter name="date_done_groupby" string="Date Done"
context="{'group_by': 'date_done:day'}"/>
</filter>
<filter name="expected_date" position="attributes">
<!-- group per day -->
<attribute name="context">{'group_by': 'scheduled_date:day'}</attribute>
</filter>
</field>
</record>
<record id="stock_picking_pivot" model="ir.ui.view">
<field name="name">stock_usability.picking_pivot</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<pivot string="Transfers">
<field name="date_done" type="row" interval="month"/>
</pivot>
</field>
</record>
<record id="stock.action_picking_tree_all" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
</record>
<record id="stock.stock_picking_action_picking_type" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
</record>
<record id="stock.action_picking_tree_ready" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
</record>
<record id="stock.action_picking_tree_waiting" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
</record>
<record id="stock.action_picking_tree_late" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,calendar,pivot</field> <!-- add pivot -->
</record>
<record id="stock.action_picking_tree_backorder" model="ir.actions.act_window">
<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>

View File

@@ -0,0 +1,64 @@
<?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_stock_quant_tree" model="ir.ui.view">
<field name="name">stock.usability.quant.tree</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
<field name="arch" type="xml">
<field name="quantity" position="attributes">
<attribute name="sum">1</attribute>
</field>
<field name="available_quantity" position="attributes">
<attribute name="sum">1</attribute>
</field>
</field>
</record>
<!--
<record id="view_stock_quant_form" model="ir.ui.view">
<field name="name">stock.usability.quant.form</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" icon="fa-arrows-v" type="object" name="action_stock_move_lines_reserved" string="Reservations"/>
</div>
</field>
</record>
-->
<!-- more detailed stock.move tree view when using the button from product form -->
<!-- TODO TEST
<record id="stock.act_product_stock_move_open" model="ir.actions.act_window">
<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">
<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"/>
<!--
<record id="stock.action_production_lot_form" model="ir.actions.act_window">
<field name="context">{}</field>
</record>
-->
</odoo>

View File

@@ -0,0 +1,29 @@
<?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_warehouse" model="ir.ui.view">
<field name="name">stock.usability.warehouse.form</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse" />
<field name="arch" type="xml">
<xpath expr="//field[@name='out_type_id']/.." position="after">
<group name="routes" string="Routes">
<field name="route_ids" widget="many2many_tags"/>
<field name="crossdock_route_id"/>
<field name="reception_route_id"/>
<field name="delivery_route_id"/>
<field name="resupply_route_ids"/>
</group>
</xpath>
</field>
</record>
</odoo>