Hello,
I want to restrict users from accessing venders details from POS screen but they need to give access to clients details.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I want to restrict users from accessing venders details from POS screen but they need to give access to clients details.
Restricting users from accessing vendor details in POS (Point of Sale) V17 while allowing access to client details can be managed through a combination of access rights, record rules, and slight modifications to the POS screen. Here's how you can achieve this:
By default, the Point of Sale module uses the res.partner model for both vendors and customers (clients). To restrict access to vendor details specifically, you need to define rules that:
To distinguish vendors from customers, use the supplier_rank field on res.partner.
Define a record rule that restricts access to vendor records for the POS Limited Access group.
['|', ('supplier_rank', '=', 0), ('supplier_rank', '=', False)]
This rule ensures that users in the POS Limited Access group can only see partners who are not vendors.
The above steps restrict access to vendor records at the backend level. However, in the POS interface, you may need to customize the displayed data to ensure vendor details are not accessible.
/** @odoo-module **/
import PosDB from 'point_of_sale.models';
const PosModelSuper = PosDB.prototype.models;
PosDB.prototype.models = PosModelSuper.map(model => {
if (model.model === 'res.partner') {
model.domain = [['customer_rank', '>', 0]];
}
return model;
});
To explicitly show only customers in the POS interface, add a filter button that automatically applies customer_rank > 0.
If POS users also have access to modules like Purchases or Contacts, ensure similar record rules are applied there.
By implementing the above steps, you can effectively restrict POS users from accessing vendor details while still allowing access to customer details. Let me know if you need further guidance or code snippets for customization!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up