addons/pos_hr/static/src/app/components/popups/closing_popup/closing_popup.js
raw| 1 | import { ClosePosPopup } from "@point_of_sale/app/components/popups/closing_popup/closing_popup"; |
| 2 | import { patch } from "@web/core/utils/patch"; |
| 3 | |
| 4 | patch(ClosePosPopup.prototype, { |
| 5 | hasUserAuthority() { |
| 6 | if (!this.pos.config.module_pos_hr) { |
| 7 | return super.hasUserAuthority(); |
| 8 | } |
| 9 | const cashier = this.pos.cashier; |
| 10 | return ( |
| 11 | (cashier._role == "manager" && cashier._user_role == "admin") || |
| 12 | this.allowedDifference() |
| 13 | ); |
| 14 | }, |
| 15 | }); |