summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js')
-rw-r--r--addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js b/addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js
new file mode 100644
index 00000000..02e61967
--- /dev/null
+++ b/addons/point_of_sale/static/src/js/ChromeWidgets/CashierName.js
@@ -0,0 +1,23 @@
+odoo.define('point_of_sale.CashierName', function(require) {
+ 'use strict';
+
+ const PosComponent = require('point_of_sale.PosComponent');
+ const Registries = require('point_of_sale.Registries');
+
+ // Previously UsernameWidget
+ class CashierName extends PosComponent {
+ get username() {
+ const cashier = this.env.pos.get_cashier();
+ if (cashier) {
+ return cashier.name;
+ } else {
+ return '';
+ }
+ }
+ }
+ CashierName.template = 'CashierName';
+
+ Registries.Component.add(CashierName);
+
+ return CashierName;
+});