Skip to content
Snippets Groups Projects
Commit 2e3e1ab7 authored by Jacky (trj)'s avatar Jacky (trj)
Browse files

[FIX] point_of_sale,pos_restaurant: fix auto FloorScreen when idle

- Restaurant shops should automatically go back to floor screen when
idle. However, after https://github.com/odoo/odoo/pull/89712

, this
feature is broken when pos_hr is also installed - the screen doesn't
automatically go back to floor screen.
A simple fix is to clear the tempScreen name when the shown tempScreen
is closed. Note that this change is fine because when tempScreen is closed
(!isShown), the `tempScreen.name` information has no use.

- Once the `idleTimer` is set, it is never removed. This means that
even if the conditions to go back to the FloorScreen at the current
time T are not satisfied, the `_actionAfterIdle` is still run.
Checking if the action can be done once triggered fix the issue.

closes odoo/odoo#92177

X-original-commit: d77d7e90
Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
parent a1e8d116
Branches
Tags
No related merge requests found
......@@ -274,6 +274,7 @@ odoo.define('point_of_sale.Chrome', function(require) {
}
__closeTempScreen() {
this.tempScreen.isShown = false;
this.tempScreen.name = null;
}
__showScreen({ detail: { name, props = {} } }) {
const component = this.constructor.components[name];
......
......@@ -53,6 +53,10 @@ odoo.define('pos_restaurant.chrome', function (require) {
}
}
_actionAfterIdle() {
// We also need to check if the action still need to be triggered
if (!this._shouldResetIdleTimer()) {
return;
}
if (this.tempScreen.isShown) {
this.trigger('close-temp-screen');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment