From 668b82d0a977024f76419114aa251272da78a555 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 5 Jun 2012 13:38:39 +0200 Subject: [PATCH 1/5] [FIX] point_of_sale: remove the call of the report in the pos.payment wizard bzr revid: stw@openerp.com-20120605113839-c7pb1czizw38epau --- addons/point_of_sale/wizard/pos_payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 194428db118..183ccfe32b3 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -70,7 +70,8 @@ class pos_make_payment(osv.osv_memory): if order_obj.test_paid(cr, uid, [active_id]): wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'pos.order', active_id, 'paid', cr) - return self.print_report(cr, uid, ids, context=context) + return {'type' : 'ir.actions.act_window_close' } + ##self.print_report(cr, uid, ids, context=context) return self.launch_payment(cr, uid, ids, context=context) From 85aec52251a67992c7792313e16cc1433320bba8 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 5 Jun 2012 14:02:29 +0200 Subject: [PATCH 2/5] [FIX] account: check if the journal exist on the account.bank.statement bzr revid: stw@openerp.com-20120605120229-u37kbjcdp7nbpp6e --- addons/account/wizard/pos_box.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py index 00a3c404a65..12a606833a1 100644 --- a/addons/account/wizard/pos_box.py +++ b/addons/account/wizard/pos_box.py @@ -28,6 +28,10 @@ class CashBox(osv.osv_memory): def _run(self, cr, uid, ids, records, context=None): for box in self.browse(cr, uid, ids, context=context): for record in records: + if not record.journal_id: + raise osv.except_osv(_('Error !'), + _("Please check that the field 'Journal' is set on the Bank Statement")) + if not record.journal_id.internal_account_id: raise osv.except_osv(_('Error !'), _("Please check that the field 'Internal Transfers Account' is set on the payment method '%s'.") % (record.journal_id.name,)) From d251e07d88d8373c8a3c0108f773df172efbaffa Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 5 Jun 2012 14:23:14 +0200 Subject: [PATCH 3/5] [IMP] point_of_sale: add a guardian for the account.bank.statement bzr revid: stw@openerp.com-20120605122314-byw2uq6hjlas0052 --- addons/point_of_sale/wizard/pos_box.py | 11 ++++- .../point_of_sale/wizard/pos_receipt_view.xml | 42 +++++++++---------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/addons/point_of_sale/wizard/pos_box.py b/addons/point_of_sale/wizard/pos_box.py index b4a87cb0933..a79ab0fa779 100644 --- a/addons/point_of_sale/wizard/pos_box.py +++ b/addons/point_of_sale/wizard/pos_box.py @@ -1,4 +1,6 @@ #!/usr/bin/env python + +from tools.translate import _ from osv import osv, fields from account.wizard.pos_box import CashBox @@ -14,7 +16,14 @@ class PosBox(CashBox): if active_model == 'pos.session': records = self.pool.get(active_model).browse(cr, uid, context.get('active_ids', []) or [], context=context) - return self._run(cr, uid, ids, [record.cash_register_id for record in records], context=context) + + bank_statements = [record.cash_register_id for record in records if record.cash_register_id] + + if not bank_statements: + raise osv.except_osv(_('Error !'), + _("There is no cash register for this PoS Session")) + + return self._run(cr, uid, ids, bank_statements, context=context) else: return super(PosBox, self).run(cr, uid, ids, context=context) diff --git a/addons/point_of_sale/wizard/pos_receipt_view.xml b/addons/point_of_sale/wizard/pos_receipt_view.xml index 0b8acfd8197..5ec8ee9d1ed 100644 --- a/addons/point_of_sale/wizard/pos_receipt_view.xml +++ b/addons/point_of_sale/wizard/pos_receipt_view.xml @@ -1,32 +1,28 @@ - + + + + Receipt + pos.receipt + form + +
+ +