Skip to content

Commit

Permalink
Putaway: show rainbow man when all the lines are putaway
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen committed Jul 6, 2020
1 parent 578fd9a commit 25542c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
14 changes: 13 additions & 1 deletion stock_vertical_lift/models/vertical_lift_operation_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
from collections import namedtuple

from odoo import api, fields, models
from odoo import _, api, fields, models

from odoo.addons.base_sparse_field.models.fields import Serialized

Expand Down Expand Up @@ -244,6 +244,18 @@ def _get_tray_qty(self, product, location):
)
return sum(quants.mapped("quantity"))

def _rainbow_man(self, message=None):
if not message:
message = _("Congrats, you cleared the queue!")
return {
"effect": {
"fadeout": "slow",
"message": message,
"img_url": "/web/static/src/img/smile.svg",
"type": "rainbow_man",
}
}

def _send_notification_refresh(self):
"""Send a refresh notification
Expand Down
11 changes: 2 additions & 9 deletions stock_vertical_lift/models/vertical_lift_operation_inventory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.tools import float_compare

from odoo.addons.base_sparse_field.models.fields import Serialized
Expand Down Expand Up @@ -265,11 +265,4 @@ def button_save(self):
self.next_step()
if self.step() == "noop":
# sorry not sorry
return {
"effect": {
"fadeout": "slow",
"message": _("Congrats, you cleared the queue!"),
"img_url": "/web/static/src/img/smile.svg",
"type": "rainbow_man",
}
}
return self._rainbow_man()
9 changes: 1 addition & 8 deletions stock_vertical_lift/models/vertical_lift_operation_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,4 @@ def button_release(self):
super().button_release()
if self.step() == "noop":
# sorry not sorry
return {
"effect": {
"fadeout": "slow",
"message": _("Congrats, you cleared the queue!"),
"img_url": "/web/static/src/img/smile.svg",
"type": "rainbow_man",
}
}
return self._rainbow_man()
6 changes: 6 additions & 0 deletions stock_vertical_lift/models/vertical_lift_operation_put.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,9 @@ def _assign_available_cell(self, tray_type):

def fetch_tray(self):
self.current_move_line_id.fetch_vertical_lift_tray_dest()

def button_release(self):
super().button_release()
if self.count_move_lines_to_do_all() == 0:
# sorry not sorry
return self._rainbow_man()

0 comments on commit 25542c0

Please sign in to comment.