[FIX] point_of_sale: allow deletion of contact to any user
Before this fix, if the user has no PoS access rights, he cannot delete a contact due to a check done on open PoS sessions. closes odoo/odoo#45868 X-original-commit: f7b83cfc41045e1cc81d2e1c5540ac105f333a61 Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
This commit is contained in:
@@ -40,7 +40,7 @@ class ResPartner(models.Model):
|
||||
return partner_id
|
||||
|
||||
def unlink(self):
|
||||
running_sessions = self.env['pos.session'].search([('state', '!=', 'closed')])
|
||||
running_sessions = self.env['pos.session'].sudo().search([('state', '!=', 'closed')])
|
||||
if running_sessions:
|
||||
raise UserError(
|
||||
_("You cannot delete contacts while there are active PoS sessions. Close the session(s) %s first.")
|
||||
|
||||
Reference in New Issue
Block a user