Unable to disable the Paid option for Users in the drop down menu. I want to edit the xml to have the Paid button visible only to the PoS Administrator. To find this option you login to the PoS App and click on the hamburger icon at the top right corner of the screen next to the WiFi icon. You then select Orders, the Paid button is part of the drop down menu items available after clicking on the "All active orders" button next to the search input field.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Dear Solo Obiri,
Go to Settings > Security > Groups.
Create a new group (e.g., "Group: PoS Cashier") if you don't have one for non-administrator users.
Edit the existing "Point of Sale Administrator" group.
Under the "Point of Sale" access rights, uncheck the box for "Validate Order (Payment)".
Hi,
To show or hide the 'Paid' option based on user group, follow these steps:
1. Import the necessary modules:
import { SearchBar } from "@point_of_sale/app/screens/ticket_screen/search_bar/search_bar";
import { useService } from "@web/core/utils/hooks";
import { patch } from "@web/core/utils/patch";
import { onWillStart } from "@odoo/owl";
2. Patch the SearchBar prototype to modify its setup method:
patch(SearchBar.prototype, {
setup(_defaultObj, options) {
super.setup(...arguments);
this.user = useService("user");
onWillStart(async () => {
this.isPosManager = await this.user.hasGroup('point_of_sale.group_pos_manager');
if (!this.isPosManager) {
this.filterOptionsList = this.filterOptionsList.filter(option => option !== 'SYNCED');
}
})
},
})
3. Ensure to add the JavaScript file to the manifest under 'assets':
"assets": {
"point_of_sale._assets_pos": ["path"]
}
Replace "path" with the actual path to your JavaScript file.
Hope it helps
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden
@Cybrosys I am using odoo online and i wasn't able to implement your solution to know if it would work. Not a developer so can you let me know what other method is available to enable this feature. Is it possible to edit the views or templates?
I would like to know the QWeb template that generates the view.