[MIG] stock_usability_akretion to v18
This commit is contained in:
@@ -1,2 +1 @@
|
||||
from . import models
|
||||
from .post_install import create_config_parameter_immediate_tranfer
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Copyright 2014-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2014-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
{
|
||||
'name': 'Stock Usability',
|
||||
'version': '16.0.1.0.0',
|
||||
'version': '18.0.1.0.0',
|
||||
'category': 'Inventory, Logistic, Storage',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Several usability enhancements in Warehouse management',
|
||||
@@ -23,7 +23,7 @@ The usability enhancements include:
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['stock'],
|
||||
'data': [
|
||||
'views/stock_quant.xml',
|
||||
@@ -40,6 +40,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
||||
'views/procurement_scheduler_log.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'post_init_hook': 'create_config_parameter_immediate_tranfer',
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2024 Akretion France (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2022 Akretion France
|
||||
# Copyright 2016-2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -10,12 +10,9 @@ class ProductTemplate(models.Model):
|
||||
|
||||
tracking = fields.Selection(tracking=True)
|
||||
sale_delay = fields.Float(tracking=True)
|
||||
# the 'stock' module adds 'product' in detailed_type...
|
||||
# but forgets to make it the default
|
||||
detailed_type = fields.Selection(default='product')
|
||||
|
||||
def action_view_stock_move(self):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("stock.stock_move_action")
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("stock_usability_akretion.stock_move_list_first_action")
|
||||
action['domain'] = [('product_id.product_tmpl_id', 'in', self.ids)]
|
||||
action['context'] = {'search_default_done': True}
|
||||
return action
|
||||
@@ -25,7 +22,7 @@ class ProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
def action_view_stock_move(self):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("stock.stock_move_action")
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("stock_usability_akretion.stock_move_list_first_action")
|
||||
action['domain'] = [('product_id', 'in', self.ids)]
|
||||
action['context'] = {'search_default_done': True}
|
||||
return action
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2022 Akretion France (https://akretion.com/)
|
||||
# Copyright 2017-2024 Akretion France (https://akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2014-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2014-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -26,5 +26,6 @@ class StockMove(models.Model):
|
||||
"data-oe-id=%d>%s</a> qty %s %s <b>unreserved</b>")
|
||||
% (product.id, product.display_name,
|
||||
move.product_qty, product.uom_id.name))
|
||||
# fields 'product_qty' has digits=0... strange. So I can't use formatLang()
|
||||
# Copied from do_unreserved of stock.picking
|
||||
picking.package_level_ids.filtered(lambda p: not p.move_ids).unlink()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# Copyright 2014-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2014-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, _
|
||||
from odoo.tools.misc import formatLang
|
||||
from odoo.exceptions import UserError
|
||||
from markupsafe import Markup
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -12,7 +14,7 @@ logger = logging.getLogger(__name__)
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = 'stock.move.line'
|
||||
|
||||
# for optional display in tree view
|
||||
# for optional display in list view
|
||||
product_barcode = fields.Char(
|
||||
related='product_id.barcode', string="Product Barcode")
|
||||
|
||||
@@ -27,11 +29,13 @@ class StockMoveLine(models.Model):
|
||||
picking = moveline.move_id.picking_id
|
||||
if picking:
|
||||
product = moveline.product_id
|
||||
product_link = Markup(
|
||||
"<a href=# data-oe-model=product.product data-oe-id=%s>%s</a>" % (product.id, product.display_name))
|
||||
picking.message_post(body=_(
|
||||
"Product <a href=# data-oe-model=product.product "
|
||||
"data-oe-id=%d>%s</a> qty %s %s <b>unreserved</b>")
|
||||
% (product.id, product.display_name,
|
||||
moveline.reserved_qty, product.uom_id.name))
|
||||
"Product %(product_link)s qty %(qty)s %(uom)s unreserved",
|
||||
product_link=product_link,
|
||||
qty=formatLang(self.env, moveline.quantity, dp='Product Unit of Measure'),
|
||||
uom=product.uom_id.name))
|
||||
# Copied from do_unreserved of stock.picking
|
||||
picking.package_level_ids.filtered(lambda p: not p.move_ids).unlink()
|
||||
moveline.unlink()
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
# Copyright 2014-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2014-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, _
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
# _order = 'id desc'
|
||||
# In the stock module: _order = "priority desc, scheduled_date asc, id desc"
|
||||
# The problem is date asc
|
||||
# In the stock module: _order = "is_favorite desc, sequence, id"
|
||||
|
||||
partner_id = fields.Many2one(tracking=True)
|
||||
picking_type_id = fields.Many2one(tracking=True)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2023 Akretion (http://www.akretion.com)
|
||||
# Copyright 2023-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2014-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2014-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -17,7 +17,7 @@ class StockQuant(models.Model):
|
||||
"stock.stock_move_line_action")
|
||||
action['domain'] = [
|
||||
('state', 'not in', ('draft', 'done', 'cancel')),
|
||||
('reserved_uom_qty', '!=', 0),
|
||||
('quantity', '!=', 0),
|
||||
('product_id', '=', self.product_id.id),
|
||||
('location_id', '=', self.location_id.id),
|
||||
('lot_id', '=', self.lot_id.id or False),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2024 Akretion (https://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# Copyright 2021-2022 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
from odoo import SUPERUSER_ID, api
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def create_config_parameter_immediate_tranfer(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
ico = env["ir.config_parameter"]
|
||||
conf_param = ico.search([('key', '=', 'stock.no_default_immediate_tranfer')])
|
||||
if not conf_param:
|
||||
ico.create({
|
||||
'key': 'stock.no_default_immediate_tranfer',
|
||||
'value': 'True',
|
||||
})
|
||||
logger.info(
|
||||
'ir.config_parameter stock.no_default_immediate_tranfer created')
|
||||
else:
|
||||
logger.info(
|
||||
'ir.config_parameter stock.no_default_immediate_tranfer '
|
||||
'already exists')
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2015-2024 Akretion France (https://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 2015-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2015-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -11,19 +11,35 @@
|
||||
<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">
|
||||
<list>
|
||||
<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 name="company_id" column_invisible="1"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="procurement_scheduler_log_search" model="ir.ui.view">
|
||||
<field name="model">procurement.scheduler.log</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="create_uid"/>
|
||||
<separator/>
|
||||
<filter string="Start Date" name="start_datetime" date="start_datetime"/>
|
||||
<group name="groupby">
|
||||
<filter name="start_datetime_groupby" string="Start Date" context="{'group_by': 'start_datetime'}"/>
|
||||
<filter name="create_uid_groupby" string="Executed by" context="{'group_by': 'create_uid'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</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>
|
||||
<field name="view_mode">list</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="procurement_scheduler_log_menu"
|
||||
|
||||
@@ -13,21 +13,18 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_product_template_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="responsible_id" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</field>
|
||||
<field name="virtual_available" position="before">
|
||||
<field name="incoming_qty" optional="hide" sum="1"/>
|
||||
<field name="outgoing_qty" optional="hide" sum="1"/>
|
||||
<!-- we would like to also have free_qty, as on product.product, but this field doesn't exist on product.template -->
|
||||
</field>
|
||||
<!-- we have sum=1 on product.product qty fields, but not on product.template...so I add it on product.template -->
|
||||
<field name="virtual_available" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="qty_available" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="virtual_available" position="before">
|
||||
<field name="incoming_qty" optional="hide" sum="1"/>
|
||||
<field name="outgoing_qty" optional="hide" sum="1"/>
|
||||
<!-- we would like to also have free_qty, as on product.product, but this field doesn't exist on product.template -->
|
||||
</field>
|
||||
<!-- we have sum=1 on product.product qty fields, but not on product.template...so I add it on product.template -->
|
||||
<field name="virtual_available" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="qty_available" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -37,13 +34,17 @@
|
||||
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_stock_move_lines" position="before">
|
||||
<button string="Stock Moves"
|
||||
<button
|
||||
type="object"
|
||||
name= "action_view_stock_move"
|
||||
attrs="{'invisible': [('type', 'not in', ('product', 'consu'))]}"
|
||||
invisible="type != 'consu'"
|
||||
groups="stock.group_stock_user"
|
||||
class="oe_stat_button" icon="fa-exchange"
|
||||
/>
|
||||
>
|
||||
<div class="o_stat_info">
|
||||
<span class="o_stat_text">Stock Moves</span>
|
||||
</div>
|
||||
</button>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
@@ -57,7 +58,7 @@
|
||||
<button string="Stock Moves"
|
||||
type="object"
|
||||
name= "action_view_stock_move"
|
||||
attrs="{'invisible': [('type', 'not in', ('product', 'consu'))]}"
|
||||
invisible="type != 'consu'"
|
||||
groups="stock.group_stock_user"
|
||||
class="oe_stat_button" icon="fa-exchange"
|
||||
/>
|
||||
|
||||
@@ -1,51 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion France (https://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="location_open_quants_regular_tree" model="ir.actions.act_window">
|
||||
<field name="name">Quants</field>
|
||||
<field name="res_model">stock.quant</field>
|
||||
<field name="domain">[('location_id', 'child_of', active_ids)]</field>
|
||||
<field name="view_id" ref="stock_usability.stock_quant_tree_simple"/>
|
||||
</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_quants_regular_tree)d"
|
||||
string="Quants"
|
||||
class="oe_stat_button" icon="fa-cubes"/>
|
||||
<button type="action" name="%(location_open_orderpoint)d"
|
||||
string="Reordering Rules"
|
||||
class="oe_stat_button" icon="fa-refresh"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2022-2024 Akretion France (https://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
|
||||
<record id="stock.action_production_lot_form" model="ir.actions.act_window">
|
||||
<!-- remove from context 'search_default_group_by_product': 1-->
|
||||
<field name="context">{'display_complete': True, 'default_company_id': allowed_company_ids[0]}</field>
|
||||
<!-- remove from context 'search_default_group_by_location': 1-->
|
||||
<field name="context">{'display_complete': True}</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_line_from_lot_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Moves</field>
|
||||
<field name="res_model">stock.move.line</field>
|
||||
<field name="view_mode">tree,kanban,pivot,form</field>
|
||||
<field name="view_mode">list,kanban,pivot,form</field>
|
||||
<field name="domain">[('lot_id', '=', active_id)]</field>
|
||||
<field name="context">{'search_default_done': 1, 'create': 0}</field>
|
||||
</record>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -35,10 +35,10 @@
|
||||
</group>
|
||||
</group>
|
||||
<group name="linked_group" position="after">
|
||||
<group name="move_line_ids" string="Product Moves" colspan="2">
|
||||
<field name="move_line_ids" nolabel="1" readonly="1" colspan="2"/>
|
||||
<group name="move_line_ids" string="Product Moves" colspan="2">
|
||||
<field name="move_line_ids" nolabel="1" readonly="1" colspan="2"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<field name="state" position="after">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
states="partially_available,assigned"
|
||||
invisible="state not in ('partially_available', 'assigned')"
|
||||
icon="fa-ban"/>
|
||||
</field>
|
||||
<field name="product_id" position="after">
|
||||
@@ -63,4 +63,13 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- In the stock module, there is only 1 ir.actions.act_window
|
||||
for stock.move which has pivot as first view. -->
|
||||
<record id="stock_move_list_first_action" model="ir.actions.act_window">
|
||||
<field name="name">Stock Moves</field>
|
||||
<field name="res_model">stock.move</field>
|
||||
<field name="view_mode">list,pivot,graph,kanban,form</field>
|
||||
<field name="view_id" ref="stock.view_move_tree"/> <!-- force specific list view -->
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion France (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -12,16 +12,13 @@
|
||||
<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">
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
<field name="state" position="after">
|
||||
<field name="create_uid" position="after">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
states="partially_available,assigned"
|
||||
invisible="state not in ('partially_available', 'assigned')"
|
||||
icon="fa-ban"/>
|
||||
</field>
|
||||
<field name="product_id" position="after">
|
||||
@@ -38,10 +35,7 @@
|
||||
<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">
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -14,52 +14,40 @@
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="backorder_id" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
<attribute name="invisible">0</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">
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='product_uom_qty']" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='quantity_done']" position="attributes">
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='quantity']" 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='name']" position="replace"/>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="after">
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='location_id']" position="replace"/>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='location_dest_id']" position="replace"/>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='name']" position="replace"/>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='product_id']" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
<field name="name" optional="hide"/>
|
||||
<field name="location_id" groups="stock.group_stock_multi_locations" optional="show" domain="[('id', 'child_of', 'parent.location_id')]" options="{'no_create': True}"/>
|
||||
<field name="location_dest_id" groups="stock.group_stock_multi_locations" optional="show" domain="[('id', 'child_of', 'parent.location_dest_id')]" options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/tree/button[@name='action_assign_serial']" position="after">
|
||||
<xpath expr="//field[@name='move_ids_without_package']/list" position="inside">
|
||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||
groups="stock.group_stock_user"
|
||||
states="partially_available,assigned"
|
||||
invisible="state not in ('partially_available', 'assigned')"
|
||||
icon="fa-ban"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_ids_without_package']/form//field[@name='product_uom']" position="after">
|
||||
<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' and @groups='stock.group_stock_multi_locations']" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
<attribute name="invisible">0</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//sheet/group/group/field[@name='location_dest_id' and @groups='stock.group_stock_multi_locations']" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
<attribute name="invisible">0</attribute>
|
||||
</xpath>
|
||||
<group name="other_infos" position="inside">
|
||||
<!-- the field picking_type_id is shown at the top of the form view when hide_picking_type = False, which depend on a context key. I want to always show it in the last tab -->
|
||||
<field name="picking_type_id" readonly="1"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -71,14 +59,9 @@
|
||||
<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>
|
||||
context="{'group_by': 'date_done'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
@@ -87,34 +70,46 @@
|
||||
<field name="name">stock_usability.picking_pivot</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="Transfers">
|
||||
<pivot>
|
||||
<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 -->
|
||||
<field name="view_mode">list,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 id="stock.action_picking_tree_incoming" model="ir.actions.act_window">
|
||||
<field name="view_mode">list,kanban,form,calendar,activity,pivot</field> <!-- add pivot -->
|
||||
</record>
|
||||
|
||||
<record id="stock.action_picking_tree_outgoing" model="ir.actions.act_window">
|
||||
<field name="view_mode">list,kanban,form,calendar,activity,pivot</field> <!-- add pivot -->
|
||||
</record>
|
||||
|
||||
<record id="stock.action_picking_tree_internal" model="ir.actions.act_window">
|
||||
<field name="view_mode">list,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 -->
|
||||
<field name="view_mode">list,kanban,form,calendar,pivot</field> <!-- add pivot -->
|
||||
</record>
|
||||
|
||||
<record id="stock.action_picking_tree_graph" model="ir.actions.act_window">
|
||||
<field name="view_mode">list,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 -->
|
||||
<field name="view_mode">list,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 -->
|
||||
<field name="view_mode">list,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 -->
|
||||
<field name="view_mode">list,kanban,form,calendar,pivot</field> <!-- add pivot -->
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2023 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion France (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -24,8 +24,12 @@
|
||||
<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 name="default_location_src_id" optional="show"/>
|
||||
<field name="default_location_dest_id" optional="show"/>
|
||||
<field name="return_picking_type_id" optional="hide"/>
|
||||
</field>
|
||||
<field name="sequence_id" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -8,18 +8,16 @@
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<record id="view_stock_quant_tree_simple" 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="inherit_id" ref="stock.view_stock_quant_tree_simple"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</field>
|
||||
<!-- Move available_quantity AFTER quantity -->
|
||||
<field name="quantity" position="after">
|
||||
<field name="reserved_quantity" sum="1" optional="show"/>
|
||||
<field name="available_quantity" position="move"/>
|
||||
</field>
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
@@ -32,20 +30,18 @@
|
||||
</record>
|
||||
|
||||
<!-- view used from product form -->
|
||||
<record id="view_stock_quant_tree_inventory_editable" model="ir.ui.view">
|
||||
<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_inventory_editable"/>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<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>
|
||||
<button name="action_view_stock_moves" position="before">
|
||||
<button type="object" name="action_stock_move_lines_reserved" string="Reservations" invisible="reserved_quantity == 0"/>
|
||||
</button>
|
||||
<!--
|
||||
<field name="quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
</field>
|
||||
</field> -->
|
||||
<field name="available_quantity" position="attributes">
|
||||
<attribute name="sum">1</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
</field>
|
||||
@@ -65,38 +61,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_tree_simple" model="ir.ui.view">
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">100</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree edit="0" create="0" delete="0">
|
||||
<field name="location_id"/>
|
||||
<field name="product_id" />
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
||||
<field name="quantity" sum="1"/>
|
||||
<field name="product_uom_id" string="Unit" groups="uom.group_uom"/>
|
||||
<field name="reserved_quantity" string="Reserved" sum="1" optional="show"/>
|
||||
<button type="object" name="action_stock_move_lines_reserved" string="Reservations" attrs="{'invisible': [('reserved_quantity', '=', 0)]}"/>
|
||||
<field name="available_quantity" string="Available" sum="1" optional="show"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</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>
|
||||
@@ -117,16 +81,4 @@
|
||||
</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> -->
|
||||
|
||||
<!-- Rename menu entry Locations -> Quants -->
|
||||
<record id="stock.menu_valuation" model="ir.ui.menu">
|
||||
<field name="name">Quants</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -19,7 +19,7 @@
|
||||
<field name="crossdock_route_id"/>
|
||||
<field name="reception_route_id"/>
|
||||
<field name="delivery_route_id"/>
|
||||
<field name="resupply_route_ids"/>
|
||||
<field name="resupply_route_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2014-2024 Akretion (https://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
Reference in New Issue
Block a user