From 6f18cffb60c4a55c8d6efebc78468e44634c4c96 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Tue, 23 May 2023 08:55:45 +0000 Subject: [PATCH] [REF] point_of_sale, pos*: remove BackendButton component pos*: point_of_sale, pos_hr, pos_restaurant, pos_sale This component is purely presentational and contains no code, it's also only used once (it was actually used a second time in pos_hr only because the way the xpath was written would replace the existing instance with a new one with an added t-if, we can just use an attribute xpath instead). Existing xpaths have been adapted such that the burger menu's dropdown structure is better semantically (an unordered list containing list items, instead of containing list elements inside of random divs) Part-of: odoo/odoo#122035 --- .../static/src/app/navbar/navbar.js | 2 -- .../static/src/app/navbar/navbar.xml | 12 ++++++---- .../src/js/ChromeWidgets/BackendButton.js | 17 -------------- .../src/xml/ChromeWidgets/BackendButton.xml | 12 ---------- addons/pos_hr/static/src/app/navbar.xml | 23 +++++++++++-------- .../static/src/app/navbar/navbar.xml | 2 +- addons/pos_six/static/app/navbar.xml | 2 +- 7 files changed, 23 insertions(+), 47 deletions(-) delete mode 100644 addons/point_of_sale/static/src/js/ChromeWidgets/BackendButton.js delete mode 100644 addons/point_of_sale/static/src/xml/ChromeWidgets/BackendButton.xml diff --git a/addons/point_of_sale/static/src/app/navbar/navbar.js b/addons/point_of_sale/static/src/app/navbar/navbar.js index 9823320664b..23ee574e7d9 100644 --- a/addons/point_of_sale/static/src/app/navbar/navbar.js +++ b/addons/point_of_sale/static/src/app/navbar/navbar.js @@ -9,7 +9,6 @@ import { HeaderButton } from "@point_of_sale/js/ChromeWidgets/HeaderButton"; import { ProxyStatus } from "@point_of_sale/js/ChromeWidgets/ProxyStatus"; import { SaleDetailsButton } from "@point_of_sale/js/ChromeWidgets/SaleDetailsButton"; import { SyncNotification } from "@point_of_sale/js/ChromeWidgets/SyncNotification"; -import { BackendButton } from "@point_of_sale/js/ChromeWidgets/BackendButton"; import { CashMovePopup } from "./cash_move_popup/cash_move_popup"; import { TicketScreen } from "@point_of_sale/js/Screens/TicketScreen/TicketScreen"; import { Component, useState, useExternalListener } from "@odoo/owl"; @@ -24,7 +23,6 @@ export class Navbar extends Component { ProxyStatus, SaleDetailsButton, SyncNotification, - BackendButton, }; static props = { showCashMoveButton: Boolean, diff --git a/addons/point_of_sale/static/src/app/navbar/navbar.xml b/addons/point_of_sale/static/src/app/navbar/navbar.xml index 4ca2504a4e3..3fb3f62b6d4 100644 --- a/addons/point_of_sale/static/src/app/navbar/navbar.xml +++ b/addons/point_of_sale/static/src/app/navbar/navbar.xml @@ -32,11 +32,13 @@ Cash In/Out -
- -
- -
+ +
+
- - - diff --git a/addons/pos_hr/static/src/app/navbar.xml b/addons/pos_hr/static/src/app/navbar.xml index f792a4c1c1b..313d8e4dbdb 100644 --- a/addons/pos_hr/static/src/app/navbar.xml +++ b/addons/pos_hr/static/src/app/navbar.xml @@ -2,15 +2,20 @@ - -
- - - -
- -
-
+ + + !pos.globalState.config.module_pos_hr or pos.globalState.get_cashier().role === 'manager' or pos.globalState.get_cashier_user_id() === pos.globalState.user.id + + + + + + !pos.globalState.config.module_pos_hr or pos.globalState.get_cashier().role === 'manager' or pos.globalState.get_cashier_user_id() === pos.globalState.user.id + + + + +
diff --git a/addons/pos_restaurant/static/src/app/navbar/navbar.xml b/addons/pos_restaurant/static/src/app/navbar/navbar.xml index d404f152b6c..e61e4a61a68 100644 --- a/addons/pos_restaurant/static/src/app/navbar/navbar.xml +++ b/addons/pos_restaurant/static/src/app/navbar/navbar.xml @@ -2,7 +2,7 @@ - + diff --git a/addons/pos_six/static/app/navbar.xml b/addons/pos_six/static/app/navbar.xml index 5154f5682c3..9f5bebb5ff1 100644 --- a/addons/pos_six/static/app/navbar.xml +++ b/addons/pos_six/static/app/navbar.xml @@ -2,7 +2,7 @@ - +