[IMP] point_of_sale: Call the front-end from the back-end
bzr revid: stw@openerp.com-20120525130759-tmkuks2nw9oy91ot
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -863,6 +863,7 @@
|
||||
<button name="cashbox_control" type="workflow" string="End of Session" states="opened" />
|
||||
<button name="close" type="workflow" string="Validate & 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" />
|
||||
|
||||
Reference in New Issue
Block a user