Files
stock-logistics-warehouse/stock_quant_view_reservation/models/stock_quant.py
2022-06-09 12:00:57 +02:00

25 lines
678 B
Python

# 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