[FIX] config_id problem with pos session.--fixes:lp1098226
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Thu, 17 Jan 2013 11:58:14 +0000 (17:28 +0530)
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Thu, 17 Jan 2013 11:58:14 +0000 (17:28 +0530)
bzr revid: bth@tinyerp.com-20130117115814-kf2365ydkq5fwu5i

addons/point_of_sale/point_of_sale.py
addons/point_of_sale/wizard/pos_session_opening.py

index 970eb1f..22a6b5c 100644 (file)
@@ -290,7 +290,7 @@ class pos_session(osv.osv):
 
     _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):
index 1aa4cb7..ac64da7 100644 (file)
@@ -88,6 +88,7 @@ class pos_session_opening(osv.osv_memory):
         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)