mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[13.0] add stock_quant_view_reservations
This commit is contained in:
committed by
Xavier Bouquiaux
parent
959ccf7b50
commit
173198e287
35
stock_quant_view_reservation/README.rst
Normal file
35
stock_quant_view_reservation/README.rst
Normal file
@@ -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 <https://pypi.org/project/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 <https://github.com/OCA/maintainer-tools>`_.
|
||||
1
stock_quant_view_reservation/__init__.py
Normal file
1
stock_quant_view_reservation/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
14
stock_quant_view_reservation/__manifest__.py
Normal file
14
stock_quant_view_reservation/__manifest__.py
Normal file
@@ -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"],
|
||||
}
|
||||
1
stock_quant_view_reservation/models/__init__.py
Normal file
1
stock_quant_view_reservation/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import stock_quant
|
||||
24
stock_quant_view_reservation/models/stock_quant.py
Normal file
24
stock_quant_view_reservation/models/stock_quant.py
Normal file
@@ -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
|
||||
1
stock_quant_view_reservation/readme/CONTRIBUTORS.rst
Normal file
1
stock_quant_view_reservation/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
||||
* Cédric Pigeon <cedric.pigeon@acsone.eu>
|
||||
1
stock_quant_view_reservation/readme/DESCRIPTION.rst
Normal file
1
stock_quant_view_reservation/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module allows to see from a quant all reservation details
|
||||
2
stock_quant_view_reservation/readme/USAGE.rst
Normal file
2
stock_quant_view_reservation/readme/USAGE.rst
Normal file
@@ -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.
|
||||
BIN
stock_quant_view_reservation/static/description/icon.png
Normal file
BIN
stock_quant_view_reservation/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
17
stock_quant_view_reservation/views/stock_move_line_views.xml
Normal file
17
stock_quant_view_reservation/views/stock_move_line_views.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2020 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="view_move_line_tree">
|
||||
<field
|
||||
name="name"
|
||||
>stock.move.line.tree (in stock_quant_view_reservations)</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" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
18
stock_quant_view_reservation/views/stock_quant.xml
Normal file
18
stock_quant_view_reservation/views/stock_quant.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2020 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="stock_quant_tree_view">
|
||||
<field name="name">stock.quant.tree (in stock_quant_view_reservations)</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="reserved_quantity" position="attributes">
|
||||
<attribute name="optional" />
|
||||
</field>
|
||||
<field name="reserved_quantity" position="after">
|
||||
<button name="action_view_reservations" type="object" icon="fa-eye" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user