[13.0] add stock_quant_view_reservations

This commit is contained in:
Cédric Pigeon
2020-12-01 13:19:04 +01:00
committed by Xavier Bouquiaux
parent 959ccf7b50
commit 173198e287
11 changed files with 114 additions and 0 deletions

View 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>`_.

View File

@@ -0,0 +1 @@
from . import models

View 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"],
}

View File

@@ -0,0 +1 @@
from . import stock_quant

View 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

View File

@@ -0,0 +1 @@
* Cédric Pigeon <cedric.pigeon@acsone.eu>

View File

@@ -0,0 +1 @@
This module allows to see from a quant all reservation details

View 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View 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>

View 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>