[MERGE] Fix some bugs of the point of sale
bzr revid: stw@openerp.com-20121003080934-7viber8ldyrjgaqg
This commit is contained in:
commit
2d3d478784
|
@ -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):
|
||||
|
@ -439,10 +462,10 @@ class pos_session(osv.osv):
|
|||
context = {}
|
||||
if not ids:
|
||||
return {}
|
||||
context.update({'session_id' : ids[0]})
|
||||
context.update({'active_id': ids[0]})
|
||||
return {
|
||||
'type' : 'ir.actions.client',
|
||||
'name' : 'Start Point Of Sale',
|
||||
'name' : _('Start Point Of Sale'),
|
||||
'tag' : 'pos.ui',
|
||||
'context' : context,
|
||||
}
|
||||
|
|
|
@ -862,7 +862,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Point of Sale Session" version="7.0">
|
||||
<header>
|
||||
<button name="open" type="workflow" string="Validate & Open Session" states="opening_control" class="oe_highlight"/>
|
||||
<button name="open_cb" type="object" string="Validate & 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"
|
||||
|
@ -890,15 +890,14 @@
|
|||
<field name="cash_control" invisible="1" />
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="config_id" attrs="{'invisible' : [('config_id', '<>', False)]}"/>
|
||||
<field name="config_id" attrs="{'invisible' : [('config_id', '!=', False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="start_at" attrs="{'invisible' : [('state', '=', 'opening_control')]}"/>
|
||||
<field name="stop_at" attrs="{'invisible' : [('state', '!=', 'closed')]}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group string="Opening Cash Control" attrs="{'invisible' : [ '&' ,'!', '&', ('state', '=', 'opening_control'), ('cash_control', '=', True), ('state', '!=',
|
||||
'closed')] }" >
|
||||
<group string="Opening Cash Control" attrs="{'invisible' : [('cash_control', '=', False)]}">
|
||||
<field name="opening_details_ids" nolabel="1" colspan="2" attrs="{'readonly' : [('state', 'not in', ('opening_control',))]}">
|
||||
<tree string="Opening Cashbox Lines" editable="bottom">
|
||||
<field name="pieces" readonly="1" />
|
||||
|
@ -907,8 +906,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group string="Closing Cash Control" attrs="{'invisible' : [ '&' ,'!', '&', ('state', '=', 'closing_control'), ('cash_control', '=', True), ('state', '!=',
|
||||
'closed')] }" >
|
||||
<group string="Closing Cash Control" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
|
||||
<field name="details_ids" nolabel="1" colspan="2">
|
||||
<tree string="Cashbox Lines" editable="bottom">
|
||||
<field name="pieces" readonly="1" />
|
||||
|
@ -918,7 +916,7 @@
|
|||
</field>
|
||||
</group>
|
||||
|
||||
<div attrs="{'invisible' : [('state', '!=', 'closed')]}">
|
||||
<div attrs="{'invisible' : [('cash_control', '=', False)]}">
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
<field name="cash_register_balance_start" readonly="1" string="Opening Balance" class="oe_subtotal_footer_separator"/>
|
||||
<field name="cash_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions"/>
|
||||
|
@ -935,7 +933,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': [('state', '!=', 'closed')]}">
|
||||
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
|
||||
<field name="cash_register_balance_end_real" class="oe_subtotal_footer_separator"/>
|
||||
<field name="cash_register_difference" class="oe_subtotal_footer_separator"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue