3 from tools.translate import _
4 from osv import osv, fields
5 from account.wizard.pos_box import CashBox
10 def run(self, cr, uid, ids, context=None):
14 active_model = context.get('active_model', False) or False
15 active_ids = context.get('active_ids', []) or []
17 if active_model == 'pos.session':
18 records = self.pool.get(active_model).browse(cr, uid, context.get('active_ids', []) or [], context=context)
20 bank_statements = [record.cash_register_id for record in records if record.cash_register_id]
22 if not bank_statements:
23 raise osv.except_osv(_('Error!'),
24 _("There is no cash register for this PoS Session"))
26 return self._run(cr, uid, ids, bank_statements, context=context)
28 return super(PosBox, self).run(cr, uid, ids, context=context)
30 class PosBoxIn(PosBox):
31 _inherit = 'cash.box.in'
33 class PosBoxOut(PosBox):
34 _inherit = 'cash.box.out'