[MERGE] from stw

bzr revid: fva@openerp.com-20120817154315-yj19b39s2693apze
This commit is contained in:
Frédéric van der Essen
2012-08-17 17:43:15 +02:00
5 changed files with 18 additions and 12 deletions
@@ -34,8 +34,8 @@ class account_journal(osv.osv):
'self_checkout_payment_method' : fields.boolean('Self Checkout Payment Method'),
}
_defaults = {
'opening_control' : True,
'closing_control' : True,
'opening_control' : False,
'closing_control' : False,
'self_checkout_payment_method' : False,
}
+2 -2
View File
@@ -73,7 +73,7 @@ class pos_config(osv.osv):
help="This sequence is automatically created by OpenERP but you can change it "\
"to customize the reference numbers of your orders."),
'session_ids': fields.one2many('pos.session', 'config_id', 'Sessions'),
'group_by' : fields.boolean('Group By', help="Check this if you want to group the Journal Items by Product while closing a Session"),
'group_by' : fields.boolean('Group Journal Items', help="Check this if you want to group the Journal Items by Product while closing a Session"),
}
def name_get(self, cr, uid, ids, context=None):
@@ -89,7 +89,7 @@ class pos_config(osv.osv):
result.append((record.id, record.name+' ('+_('not used')+')'))
continue
session = record.session_ids[0]
result.append((record.id, record.name + ' ('+session.user_id.name+', '+states[session.state]+')'))
result.append((record.id, record.name + ' ('+session.user_id.name+')')) #, '+states[session.state]+')'))
return result
+5 -5
View File
@@ -776,10 +776,10 @@
<sheet>
<group>
<field name="name"/>
<field name="shop_id" widget="selection" />
<field name="shop_id" widget="selection" groups="stock.group_locations" />
<field name="journal_id" widget="selection" />
<field name="sequence_id" readonly="1"/>
<field name="group_by" />
<field name="sequence_id" readonly="1" groups="base.group_no_one" />
<field name="group_by" groups="account.group_account_user" />
</group>
<separator string="Available Payment Methods" colspan="4"/>
<field name="journal_ids" colspan="4" nolabel="1">
@@ -879,7 +879,7 @@
class="oe_highlight"/>
<button name="close" type="workflow" string="Validate Closing &amp; Post Entries" states="closing_control"
class="oe_highlight"/>
<button name="open_frontend_cb" type="object" string="Start Selling" states="opened"/>
<button name="open_frontend_cb" type="object" string="Continue Selling" states="opened"/>
<div class="oe_right">
<field name="state" widget="statusbar" statusbar_visible="opening_control,opened,closing_control,closed" nolabel="1"/>
</div>
@@ -890,7 +890,7 @@
<button name="%(action_pos_box_out)d" string="Take Money Out" type="action" states="opened,closing_control"/>
</div>
<h1 class="oe_title">
Point of Sale Session:
Session:
<field name="name" attrs="{'invisible': [('name','=','/')]}" class="oe_inline"/>
</h1>
<field name="has_opening_control" invisible="1" />
@@ -10,7 +10,7 @@ class pos_session_opening(osv.osv_memory):
_columns = {
'pos_config_id' : fields.many2one('pos.config', 'Point of Sale', required=True),
'pos_session_id' : fields.many2one('pos.session', 'PoS Session'),
'pos_state' : fields.char('Session State'),
'pos_state' : fields.char('Session State', readonly=True),
}
def open_ui(self, cr, uid, ids, context=None):
@@ -60,6 +60,12 @@ class pos_session_opening(osv.osv_memory):
}
def on_change_config(self, cr, uid, ids, config_id, context=None):
states = {
'opening_control': _('Opening Control'),
'opened': _('In Progress'),
'closing_control': _('Closing Control'),
'closed': _('Closed & Posted'),
}
result = {
'pos_session_id': False,
'pos_state': False
@@ -72,7 +78,7 @@ class pos_session_opening(osv.osv_memory):
('config_id', '=', config_id),
], context=context)
if session_ids:
result['pos_state'] = proxy.browse(cr, uid, session_ids[0], context=context).state
result['pos_state'] = states.get(proxy.browse(cr, uid, session_ids[0], context=context).state, False)
result['pos_session_id'] = session_ids[0]
return {'value' : result}
@@ -11,9 +11,9 @@
<field name="pos_config_id" on_change="on_change_config(pos_config_id)"
widget="selection" domain="[('state','=','active')]"
class="oe_inline"/>
<field name="pos_state" class="oe_inline" attrs="{'invisible' : [('pos_state', '=', False)]}" />
</group>
<field name="pos_session_id" invisible="1"/>
<field name="pos_state" invisible="1"/>
<button name="open_ui" type="object" string="Start Selling"
attrs="{'invisible' : [('pos_state', 'not in', ('opened',))]}"
class="oe_highlight"