[IMP] point_of_sale: Call the front-end from the back-end

bzr revid: stw@openerp.com-20120525130759-tmkuks2nw9oy91ot
This commit is contained in:
Stephane Wirtel
2012-05-25 15:07:59 +02:00
parent cf46c8653c
commit bd78e2ce68
2 changed files with 21 additions and 4 deletions
+15
View File
@@ -376,6 +376,21 @@ class pos_session(osv.osv):
return True
def open_frontend_cb(self, cr, uid, ids, context=None):
if not context:
context = {}
if not ids:
return {}
context.update({'session_id' : ids[0]})
return {
'type' : 'ir.actions.client',
'name' : 'Start Point Of Sale',
'tag' : 'pos.ui',
'context' : context,
}
# def get_current_session(self, cr, uid, context=None):
# # TODO: Remove this code and use a wizard in the front-end
# current_user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+6 -4
View File
@@ -863,6 +863,7 @@
<button name="cashbox_control" type="workflow" string="End of Session" states="opened" />
<button name="close" type="workflow" string="Validate &amp; Close" states="closing_control" />
<div class="oe_right">
<field name="state" widget="statusbar" statusbar_visible="opening_control,opened,closing_control,closed" nolabel="1"/>
</div>
@@ -871,10 +872,11 @@
<group colspan="4" col="4">
<field name="config_id"/>
<group colspan="2" col="2">
<button name="%(action_pos_box_in)d" string="Put Money In" type="action" states="opened"/>
<button name="%(action_pos_box_out)d" string="Take Money Out" type="action" states="opened"/>
</group>
<group colspan="2" col="2">
<button name="%(action_pos_box_in)d" string="Put Money In" type="action" states="opened"/>
<button name="%(action_pos_box_out)d" string="Take Money Out" type="action" states="opened"/>
<button name="open_frontend_cb" type="object" string="Open Point Of Sale" states="opened" />
</group>
<newline/>
<field name="user_id" />
<field name="name" />