From fc995a941099689a609335dc9e7fc14d89ae8231 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Tue, 15 Oct 2019 16:50:35 +0200 Subject: [PATCH] Add button on locations to fetch the tray --- stock_vertical_lift/models/stock_location.py | 6 ++++++ stock_vertical_lift/views/stock_location_views.xml | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/stock_vertical_lift/models/stock_location.py b/stock_vertical_lift/models/stock_location.py index 93e02cf65..dd4573228 100644 --- a/stock_vertical_lift/models/stock_location.py +++ b/stock_vertical_lift/models/stock_location.py @@ -154,3 +154,9 @@ class StockLocation(models.Model): % (self.name,) ) return True + + def button_fetch_vertical_lift_tray(self): + self.ensure_one() + if self.vertical_lift_kind in ("cell", "tray"): + self.fetch_vertical_lift_tray() + return True diff --git a/stock_vertical_lift/views/stock_location_views.xml b/stock_vertical_lift/views/stock_location_views.xml index 62c6e2996..c884825ef 100644 --- a/stock_vertical_lift/views/stock_location_views.xml +++ b/stock_vertical_lift/views/stock_location_views.xml @@ -6,6 +6,15 @@ stock.location +
+