_constraints = [
(_check_unicity, "You cannot create two active sessions with the same responsible!", ['user_id', 'state']),
- (_check_pos_config, "You cannot create two active sessions related to the same point of sale!", ['config_id']),
+ (_check_pos_config, "You cannot create two active sessions related to the same point of sale! Use not used point of sale", ['config_id']),
]
def create(self, cr, uid, values, context=None):
session_ids = proxy.search(cr, uid, [
('state', '!=', 'closed'),
('config_id', '=', config_id),
+ ('user_id', '=', uid),
], context=context)
if session_ids:
session = proxy.browse(cr, uid, session_ids[0], context=context)