stock_usability: Improve display of reservations from quants
Add link to stock.move.lines from lot form view
This commit is contained in:
@@ -8,10 +8,21 @@ from odoo import fields, models
|
||||
class StockQuant(models.Model):
|
||||
_inherit = 'stock.quant'
|
||||
|
||||
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||
product_barcode = fields.Char(
|
||||
related='product_id.barcode', string="Product Barcode")
|
||||
|
||||
def action_stock_move_lines_reserved(self):
|
||||
self.ensure_one()
|
||||
action = self.action_view_stock_moves()
|
||||
action['context'] = {'search_default_todo': True}
|
||||
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||
"stock.stock_move_line_action")
|
||||
action['domain'] = [
|
||||
('state', 'not in', ('draft', 'done')),
|
||||
('product_id', '=', self.product_id.id),
|
||||
('location_id', '=', self.location_id.id),
|
||||
('lot_id', '=', self.lot_id.id or False),
|
||||
'|',
|
||||
('package_id', '=', self.package_id.id or False),
|
||||
('result_package_id', '=', self.package_id.id or False),
|
||||
]
|
||||
action['context'] = {'create': 0}
|
||||
return action
|
||||
|
||||
Reference in New Issue
Block a user