diff --git a/stock_quant_view_reservation/README.rst b/stock_quant_view_reservation/README.rst new file mode 100644 index 000000000..38929e877 --- /dev/null +++ b/stock_quant_view_reservation/README.rst @@ -0,0 +1,35 @@ +**This file is going to be generated by oca-gen-addon-readme.** + +*Manual changes will be overwritten.* + +Please provide content in the ``readme`` directory: + +* **DESCRIPTION.rst** (required) +* INSTALL.rst (optional) +* CONFIGURE.rst (optional) +* **USAGE.rst** (optional, highly recommended) +* DEVELOP.rst (optional) +* ROADMAP.rst (optional) +* HISTORY.rst (optional, recommended) +* **CONTRIBUTORS.rst** (optional, highly recommended) +* CREDITS.rst (optional) + +Content of this README will also be drawn from the addon manifest, +from keys such as name, authors, maintainers, development_status, +and license. + +A good, one sentence summary in the manifest is also highly recommended. + + +Automatic changelog generation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`HISTORY.rst` can be auto generated using `towncrier `_. + +Just put towncrier compatible changelog fragments into `readme/newsfragments` +and the changelog file will be automatically generated and updated when a new fragment is added. + +Please refer to `towncrier` documentation to know more. + +NOTE: the changelog will be automatically generated when using `/ocabot merge $option`. +If you need to run it manually, refer to `OCA/maintainer-tools README `_. diff --git a/stock_quant_view_reservation/__init__.py b/stock_quant_view_reservation/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/stock_quant_view_reservation/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_quant_view_reservation/__manifest__.py b/stock_quant_view_reservation/__manifest__.py new file mode 100644 index 000000000..48f0231bb --- /dev/null +++ b/stock_quant_view_reservation/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Quant View Reservation", + "summary": """ + Allows to see details of reservations on a quant""", + "version": "13.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "depends": ["stock"], + "data": ["views/stock_quant.xml", "views/stock_move_line_views.xml"], +} diff --git a/stock_quant_view_reservation/models/__init__.py b/stock_quant_view_reservation/models/__init__.py new file mode 100644 index 000000000..70f8e6c8d --- /dev/null +++ b/stock_quant_view_reservation/models/__init__.py @@ -0,0 +1 @@ +from . import stock_quant diff --git a/stock_quant_view_reservation/models/stock_quant.py b/stock_quant_view_reservation/models/stock_quant.py new file mode 100644 index 000000000..b84f0e4d0 --- /dev/null +++ b/stock_quant_view_reservation/models/stock_quant.py @@ -0,0 +1,24 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockQuant(models.Model): + + _inherit = "stock.quant" + + def action_view_reservations(self): + self.ensure_one() + action = self.env.ref("stock.stock_move_line_action").read([])[0] + action.update( + { + "context": { + "search_default_location_id": self.location_id.id, + "search_default_product_id": self.product_id.id, + "search_default_todo": 1, + }, + "target": "current", + } + ) + return action diff --git a/stock_quant_view_reservation/readme/CONTRIBUTORS.rst b/stock_quant_view_reservation/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..4771f8432 --- /dev/null +++ b/stock_quant_view_reservation/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Cédric Pigeon diff --git a/stock_quant_view_reservation/readme/DESCRIPTION.rst b/stock_quant_view_reservation/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b7d2dbb02 --- /dev/null +++ b/stock_quant_view_reservation/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to see from a quant all reservation details diff --git a/stock_quant_view_reservation/readme/USAGE.rst b/stock_quant_view_reservation/readme/USAGE.rst new file mode 100644 index 000000000..e35e4fbee --- /dev/null +++ b/stock_quant_view_reservation/readme/USAGE.rst @@ -0,0 +1,2 @@ +Go to Inventory > Master Data > Products and click "On hand" smart button. +On all quants you can a button with an eye icon. It opens the move line reserving some quantities on the location. diff --git a/stock_quant_view_reservation/static/description/icon.png b/stock_quant_view_reservation/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/stock_quant_view_reservation/static/description/icon.png differ diff --git a/stock_quant_view_reservation/views/stock_move_line_views.xml b/stock_quant_view_reservation/views/stock_move_line_views.xml new file mode 100644 index 000000000..7b1aa76e2 --- /dev/null +++ b/stock_quant_view_reservation/views/stock_move_line_views.xml @@ -0,0 +1,17 @@ + + + + + stock.move.line.tree (in stock_quant_view_reservations) + stock.move.line + + + + + + + + diff --git a/stock_quant_view_reservation/views/stock_quant.xml b/stock_quant_view_reservation/views/stock_quant.xml new file mode 100644 index 000000000..ca1511bc7 --- /dev/null +++ b/stock_quant_view_reservation/views/stock_quant.xml @@ -0,0 +1,18 @@ + + + + + stock.quant.tree (in stock_quant_view_reservations) + stock.quant + + + + + + +