Skip to content

Commit

Permalink
Add button on locations to fetch the tray
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen authored and hailangvn committed Sep 16, 2021
1 parent d9d0dc8 commit 084c86b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stock_vertical_lift/models/stock_location.py
Expand Up @@ -154,3 +154,9 @@ def fetch_vertical_lift_tray(self, cell_location=None):
% (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
9 changes: 9 additions & 0 deletions stock_vertical_lift/views/stock_location_views.xml
Expand Up @@ -6,6 +6,15 @@
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock_location_tray.view_location_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button name="button_fetch_vertical_lift_tray"
string="Fetch Shuttle Tray"
type="object"
groups="stock.group_stock_manager"
class="oe_stat_button"
icon="fa-hand-paper-o"
attrs="{'invisible': [('vertical_lift_kind', 'not in', ('tray', 'cell'))]}"/>
</div>
<field name="return_location" position="after">
<field name="vertical_lift_location"
attrs="{'invisible': [('vertical_lift_kind', '!=', False), ('vertical_lift_kind', '!=', 'view')]}"
Expand Down

0 comments on commit 084c86b

Please sign in to comment.