Skip to content

Commit

Permalink
[FIX] point_of_sale: controller pos/web redirects to session opening …
Browse files Browse the repository at this point in the history
…if no opened session
  • Loading branch information
beledouxdenis committed Jan 6, 2015
1 parent 88169ec commit 6916acd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/point_of_sale/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import openerp
import time
import random
import werkzeug.utils

from openerp import http
from openerp.http import request
Expand All @@ -24,6 +25,8 @@ def a(self, debug=False, **k):

PosSession = request.registry['pos.session']
pos_session_ids = PosSession.search(cr, uid, [('state','=','opened'),('user_id','=',session.uid)], context=context)
if not pos_session_ids:
return werkzeug.utils.redirect('/web#action=point_of_sale.action_pos_session_opening')
PosSession.login(cr,uid,pos_session_ids,context=context)

modules = simplejson.dumps(module_boot(request.db))
Expand Down

0 comments on commit 6916acd

Please sign in to comment.