From 3bd0b43e8103193bb1461bbf1877eeaaf405a9f1 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 1 Oct 2012 11:52:54 +0200 Subject: [PATCH] [FIX] point_of_sale: We use a callback for the 'Validate & Open Session' button, because we want to open the PoS UI. [FIX] point_of_sale: Hide/Show the opening/closing cash control bzr revid: stw@openerp.com-20121001095254-bcteq9amp0eurn3g --- addons/point_of_sale/point_of_sale.py | 23 +++++++++++++++++++++ addons/point_of_sale/point_of_sale_view.xml | 13 ++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 920e70b7b7d..dfd0d73ad55 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -348,6 +348,29 @@ class pos_session(osv.osv): statement.unlink(context=context) return True + + 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._workflow_signal('open') + + context.update(active_id=this_record.id) + + return { + 'type' : 'ir.actions.client', + 'name' : _('Start Point Of Sale'), + 'tag' : 'pos.ui', + 'context' : context, + } + def wkf_action_open(self, cr, uid, ids, context=None): # second browse because we need to refetch the data from the DB for cash_register_id for record in self.browse(cr, uid, ids, 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 5b30ced93dd..66b7e3b6eb5 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -862,7 +862,7 @@
-