Fix 'fetch' buttons on move lines

There is no such action as 'ir.actions.do_nothing', it kinda works,
until you look into the js console and stares at the errors.

There is a nice OCA module that serves this purpose (more or less,
because it reloads the window, this is not an issue).
This commit is contained in:
Guewen Baconnier
2019-10-15 16:24:30 +02:00
committed by Hai Lang
parent abb323ce89
commit d9d0dc8d63
2 changed files with 6 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
'base_sparse_field',
'stock_location_tray', # OCA/stock-logistics-warehouse
'web_notify', # OCA/web
'web_ir_actions_act_view_reload', # OCA/web
],
'website': 'https://github.com/OCA/stock-logistics-warehouse',
'demo': [

View File

@@ -10,9 +10,12 @@ class StockMoveLine(models.Model):
def fetch_vertical_lift_tray_source(self):
self.ensure_one()
self.location_id.fetch_vertical_lift_tray()
return {"type": "ir.actions.do_nothing"}
# We reload mainly because otherwise, it would close
# the popup. This action is provided by the OCA module
# web_ir_actions_act_view_reload
return {"type": "ir.actions.act_view_reload"}
def fetch_vertical_lift_tray_dest(self):
self.ensure_one()
self.location_dest_id.fetch_vertical_lift_tray()
return {"type": "ir.actions.do_nothing"}
return {"type": "ir.actions.act_view_reload"}