summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2020-07-09 12:07:14 +0000
committerJoseph Caburnay <jcb@odoo.com>2020-08-05 13:35:08 +0000
commit9ea0aca6ea30fe42e1a7e0a4eaeb79f92a521152 (patch)
treeb3c969ef00f0bbc637d94c124202a96887df450a /addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js
parent71f719a61ea34252abdc9f1b2fb2caf8e62c7917 (diff)
[IMP] point_of_sale,pos_*: top bar improvements and ticket list
The following changes are made in this task: 1. Remove order tabs and replace with ticket list. 2. Top bar color change. 3. Search bar in the product screen is moved in the top bar. 4. List of sub-categories are now in the same line as the category breadcrumbs. closes odoo/odoo#55100 Task-id: 2276678 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js')
-rw-r--r--addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js b/addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js
index dbd21c5fd32..c2b623500c8 100644
--- a/addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js
+++ b/addons/pos_restaurant/static/src/js/ChromeWidgets/BackToFloorButton.js
@@ -1,22 +1,28 @@
-odoo.define('pos_restaurant.BackToFloorButton', function(require) {
+odoo.define('pos_restaurant.BackToFloorButton', function (require) {
'use strict';
const PosComponent = require('point_of_sale.PosComponent');
- const { useListener } = require('web.custom_hooks');
const Registries = require('point_of_sale.Registries');
+ const { posbus } = require('point_of_sale.utils');
class BackToFloorButton extends PosComponent {
- constructor() {
- super(...arguments);
- useListener('click', this._backToFloorScreen);
+ mounted() {
+ posbus.on('table-set', this, this.render);
+ }
+ willUnmount() {
+ posbus.on('table-set', this);
}
get table() {
- return this.props.table;
+ return (this.env.pos && this.env.pos.table) || null;
}
get floor() {
- return this.props.table.floor;
+ const table = this.table;
+ return table ? table.floor : null;
+ }
+ get hasTable() {
+ return this.table !== null;
}
- async _backToFloorScreen() {
+ backToFloorScreen() {
this.showScreen('FloorScreen', { floor: this.floor });
}
}