mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[14.0][ADD] stock_quant_reservation_info
This commit is contained in:
committed by
Meritxell Abellan
parent
583c66a33b
commit
db2ac23a72
0
stock_quant_reservation_info/README.rst
Normal file
0
stock_quant_reservation_info/README.rst
Normal file
3
stock_quant_reservation_info/__init__.py
Normal file
3
stock_quant_reservation_info/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import models
|
||||
16
stock_quant_reservation_info/__manifest__.py
Normal file
16
stock_quant_reservation_info/__manifest__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2019-2020 ForgeFlow S.L.
|
||||
# (https://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
"name": "Stock Move Reservation Info",
|
||||
"summary": "Allows to see the reserved info of Products",
|
||||
"version": "14.0.1.0.3",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"category": "Generic",
|
||||
"depends": ["stock"],
|
||||
"license": "AGPL-3",
|
||||
"data": ["views/stock_quant.xml", "views/stock_move_line.xml"],
|
||||
"installable": True,
|
||||
}
|
||||
2
stock_quant_reservation_info/models/__init__.py
Normal file
2
stock_quant_reservation_info/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import stock_quant
|
||||
from . import stock_move_line
|
||||
16
stock_quant_reservation_info/models/stock_move_line.py
Normal file
16
stock_quant_reservation_info/models/stock_move_line.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2022 ForgeFlow <http://www.forgeflow.com>
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = "stock.move.line"
|
||||
|
||||
def action_view_picking_from_reserved(self):
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"stock.action_picking_tree_all"
|
||||
)
|
||||
res = self.env.ref("stock.view_picking_form", False)
|
||||
action["views"] = [(res and res.id or False, "form")]
|
||||
action["res_id"] = self.picking_id.id
|
||||
return action
|
||||
31
stock_quant_reservation_info/models/stock_quant.py
Normal file
31
stock_quant_reservation_info/models/stock_quant.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright 2022 ForgeFlow <http://www.forgeflow.com>
|
||||
|
||||
from odoo import _, models
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = "stock.quant"
|
||||
|
||||
def action_reserved_moves(self):
|
||||
self.ensure_one()
|
||||
action = {
|
||||
"name": _("Reserved moves for: " + self.product_id.name),
|
||||
"view_mode": "list,form",
|
||||
"res_model": "stock.move.line",
|
||||
"views": [
|
||||
(
|
||||
self.env.ref(
|
||||
"stock_quant_reservation_info.view_stock_move_line_reserved_info_tree"
|
||||
).id,
|
||||
"list",
|
||||
),
|
||||
(False, "form"),
|
||||
],
|
||||
"type": "ir.actions.act_window",
|
||||
"context": {},
|
||||
"domain": [
|
||||
("product_id", "=", self.product_id.id),
|
||||
("product_uom_qty", ">", 0),
|
||||
],
|
||||
}
|
||||
return action
|
||||
1
stock_quant_reservation_info/readme/CONTRIBUTORS.rst
Normal file
1
stock_quant_reservation_info/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
||||
* David Jiménez <david.jimenez@forgeflow.com>
|
||||
1
stock_quant_reservation_info/readme/DESCRIPTION.rst
Normal file
1
stock_quant_reservation_info/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module allows to look which pickings, manufacture orders, etc. are reserving the products and check the following source.
|
||||
1
stock_quant_reservation_info/readme/USAGE.rst
Normal file
1
stock_quant_reservation_info/readme/USAGE.rst
Normal file
@@ -0,0 +1 @@
|
||||
Go to one product and check the quantity on hand, on that view you can see the quantity reserved and the button next to this field allows to see the pickings related to reservations.
|
||||
22
stock_quant_reservation_info/views/stock_move_line.xml
Normal file
22
stock_quant_reservation_info/views/stock_move_line.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<odoo>
|
||||
<record id="view_stock_move_line_reserved_info_tree" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.tree.reserved.info</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="move_id" />
|
||||
<field name="picking_id" />
|
||||
<button
|
||||
name="action_view_picking_from_reserved"
|
||||
type="object"
|
||||
class="btn btn-link text-info"
|
||||
icon="fa-arrow-right"
|
||||
title="Related Document"
|
||||
attrs="{'invisible': [('picking_id', '=', False)]}"
|
||||
/>
|
||||
<field name="origin" />
|
||||
<field name="product_uom_qty" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
39
stock_quant_reservation_info/views/stock_quant.xml
Normal file
39
stock_quant_reservation_info/views/stock_quant.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<odoo>
|
||||
<record id="view_stock_quant_tree_reserved_quantity_editable" model="ir.ui.view">
|
||||
<field name="name">stock.quant.inherit.form.reserved.quant.editable</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="available_quantity" position="after">
|
||||
<field name="reserved_quantity" optional="show" />
|
||||
<button
|
||||
name="action_reserved_moves"
|
||||
type="object"
|
||||
attrs="{'invisible': [('reserved_quantity', '=', 0)]}"
|
||||
class="btn btn-link text-info"
|
||||
icon="fa-info-circle"
|
||||
title="Reserved Moves"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree_reserved_quantity" model="ir.ui.view">
|
||||
<field name="name">stock.quant.inherit.form.reserved.quant</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="available_quantity" position="after">
|
||||
<field name="reserved_quantity" optional="show" />
|
||||
<button
|
||||
name="action_reserved_moves"
|
||||
type="object"
|
||||
attrs="{'invisible': [('reserved_quantity', '=', 0)]}"
|
||||
class="btn btn-link text-info"
|
||||
icon="fa-info-circle"
|
||||
title="Reserved Moves"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user