stock_usability: backport improvements from v14 (show reservations on quants tree view)

Also add button to access stock.move.line from lots
This commit is contained in:
Alexis de Lattre
2022-12-02 15:37:56 +01:00
parent f861685ae8
commit 61c3aaa532
2 changed files with 38 additions and 0 deletions

View File

@@ -147,6 +147,21 @@ class StockQuant(models.Model):
action['context'] = {'search_default_todo': True}
return action
def action_stock_move_lines_reserved(self):
self.ensure_one()
action = self.env['ir.actions.act_window'].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
class StockInventoryLine(models.Model):
_inherit = 'stock.inventory.line'