[FIX] config_id problem with pos session.--fixes:lp1098226

bzr revid: bth@tinyerp.com-20130117115814-kf2365ydkq5fwu5i
This commit is contained in:
Bhumi Thakkar (Open ERP) 2013-01-17 17:28:14 +05:30
parent a186503285
commit 8d47d83bbf
2 changed files with 2 additions and 1 deletions

View 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):

View 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)