point_of_sale模块
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.signal_workflow('open')
context.update(active_id=this_record.id)
return {
'type' : 'ir.actions.client',
'name' : _('Start Point Of Sale'),
'tag' : 'pos.ui',
'context' : context,
}
openerp.point_of_sale = function(instance) {
instance.point_of_sale = {};
instance.web.client_actions.add('pos.ui', 'instance.point_of_sale.PosWidget');
};