summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren Van Onder <jov@odoo.com>2015-09-21 14:56:21 +0200
committerJoren Van Onder <jov@odoo.com>2015-09-22 09:22:40 +0200
commit8a232e7f45eb52f6e5589ff1183d97bbd354cb7e (patch)
tree855538d5e3ef3e7f0906a0b532b734cf2c660a2c
parent973b94bd8383136d467c36cb2fb0d020ddb1823f (diff)
[FIX] point_of_sale: don't automatically open the frontend from workflow
It was preventing pos managers from opening sessions for pos users. Because pos users cannot open their own sessions, this means they couldn't do anything anymore. The reason for it is that the open frontend function checks whether or not the opened session belongs to the current user. If it doesn't, it throws a UserError, which prevents the session from being created. That's all open_frontend_cb did when called from wkf_action_open anyway, because the action it returns just gets ignored in the workflow. This also removes the validate & open session button because the only reason not to use the new dashboard to create a session is when you want to create a session for a different user. When doing that, validating and opening the session yourself makes no sense. When people do want to create a session for themselves without using the dashboard they can still do so, they will just have to save the session form and then click on the continue selling button.
-rw-r--r--addons/point_of_sale/point_of_sale.py23
-rw-r--r--addons/point_of_sale/point_of_sale_view.xml1
2 files changed, 1 insertions, 23 deletions
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 461d0a4aafb..ab2cb895254 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -546,27 +546,6 @@ class pos_session(osv.osv):
statement.unlink(context=context)
return super(pos_session, self).unlink(cr, uid, ids, context=context)
- def open_cb(self, cr, uid, ids, context=None):
- """
- call the Point Of Sale interface and set the pos.session to 'opened' (in progress)
- """
- if context is None:
- context = dict()
-
- if isinstance(ids, (int, long)):
- ids = [ids]
-
- this_record = self.browse(cr, uid, ids[0], context=context)
- this_record.signal_workflow('open')
-
- context.update(active_id=this_record.id)
-
- return {
- 'type' : 'ir.actions.act_url',
- 'url' : '/pos/web/',
- 'target': 'self',
- }
-
def login(self, cr, uid, ids, context=None):
this_record = self.browse(cr, uid, ids[0], context=context)
this_record.write({
@@ -584,7 +563,7 @@ class pos_session(osv.osv):
for st in record.statement_ids:
st.button_open()
- return self.open_frontend_cb(cr, uid, ids, context=context)
+ return True
def wkf_action_opening_control(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state' : 'opening_control'}, context=context)
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index e192e5e9322..be2ef10d227 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -772,7 +772,6 @@
<field name="arch" type="xml">
<form string="Point of Sale Session">
<header>
- <button name="open_cb" type="object" string="Validate &amp; Open Session" states="opening_control" class="oe_highlight"/>
<button name="open_frontend_cb" type="object" string="Continue Selling" states="opened"
class="oe_highlight"/>
<button name="cashbox_control" type="workflow" string="End of Session"