diff --git a/models/__pycache__/res_users.cpython-312.pyc b/models/__pycache__/res_users.cpython-312.pyc index 5d3af7a..620603c 100644 Binary files a/models/__pycache__/res_users.cpython-312.pyc and b/models/__pycache__/res_users.cpython-312.pyc differ diff --git a/models/__pycache__/restricted_models.cpython-312.pyc b/models/__pycache__/restricted_models.cpython-312.pyc index b4a26e3..a6c7e60 100644 Binary files a/models/__pycache__/restricted_models.cpython-312.pyc and b/models/__pycache__/restricted_models.cpython-312.pyc differ diff --git a/models/res_users.py b/models/res_users.py index abd2dd7..a50010c 100644 --- a/models/res_users.py +++ b/models/res_users.py @@ -9,7 +9,7 @@ class ResUsers(models.Model): 'user_id', 'warehouse_id', string="Allowed Warehouses", - help="Warehouses this user is allowed to access. Leave empty to allow all." + help="Warehouses this user is allowed to access. Leave empty to restrict access to none." ) allowed_picking_type_ids = fields.Many2many( @@ -18,7 +18,7 @@ class ResUsers(models.Model): 'user_id', 'picking_type_id', string="Allowed Picking Types", - help="Picking Types this user is allowed to access. Leave empty to allow all." + help="Picking Types this user is allowed to access. Leave empty to restrict access to none." ) allowed_location_ids = fields.Many2many( @@ -27,7 +27,7 @@ class ResUsers(models.Model): 'user_id', 'location_id', string="Allowed Locations", - help="Locations this user is allowed to access. Leave empty to allow all." + help="Locations this user is allowed to access. Leave empty to restrict access to none." ) allowed_workcenter_ids = fields.Many2many( @@ -36,7 +36,7 @@ class ResUsers(models.Model): 'user_id', 'workcenter_id', string="Allowed Work Centers", - help="Work Centers this user is allowed to access. Leave empty to allow all." + help="Work Centers this user is allowed to access. Leave empty to restrict access to none." ) allowed_approval_category_ids = fields.Many2many( @@ -45,5 +45,5 @@ class ResUsers(models.Model): 'user_id', 'category_id', string="Allowed Approvals", - help="Approval Categories this user is allowed to access. Leave empty to allow all." + help="Approval Categories this user is allowed to access. Leave empty to restrict access to none." ) diff --git a/models/restricted_models.py b/models/restricted_models.py index b0df31b..906af83 100644 --- a/models/restricted_models.py +++ b/models/restricted_models.py @@ -6,7 +6,7 @@ class StockWarehouse(models.Model): @api.model def _search(self, domain, offset=0, limit=None, order=None): - if not self.env.su and self.env.user.allowed_warehouse_ids: + if not self.env.su: domain = expression.AND([domain or [], [('id', 'in', self.env.user.allowed_warehouse_ids.ids)]]) return super()._search(domain, offset=offset, limit=limit, order=order) @@ -15,7 +15,7 @@ class StockPickingType(models.Model): @api.model def _search(self, domain, offset=0, limit=None, order=None): - if not self.env.su and self.env.user.allowed_picking_type_ids: + if not self.env.su: domain = expression.AND([domain or [], [('id', 'in', self.env.user.allowed_picking_type_ids.ids)]]) return super()._search(domain, offset=offset, limit=limit, order=order) @@ -24,7 +24,7 @@ class StockLocation(models.Model): @api.model def _search(self, domain, offset=0, limit=None, order=None): - if not self.env.su and self.env.user.allowed_location_ids: + if not self.env.su: domain = expression.AND([domain or [], [('id', 'in', self.env.user.allowed_location_ids.ids)]]) return super()._search(domain, offset=offset, limit=limit, order=order) @@ -33,7 +33,7 @@ class MrpWorkcenter(models.Model): @api.model def _search(self, domain, offset=0, limit=None, order=None): - if not self.env.su and self.env.user.allowed_workcenter_ids: + if not self.env.su: domain = expression.AND([domain or [], [('id', 'in', self.env.user.allowed_workcenter_ids.ids)]]) return super()._search(domain, offset=offset, limit=limit, order=order) @@ -42,6 +42,6 @@ class ApprovalCategory(models.Model): @api.model def _search(self, domain, offset=0, limit=None, order=None): - if not self.env.su and self.env.user.allowed_approval_category_ids: + if not self.env.su: domain = expression.AND([domain or [], [('id', 'in', self.env.user.allowed_approval_category_ids.ids)]]) return super()._search(domain, offset=offset, limit=limit, order=order)