From 06852d994b287e3af74a629a8feb55ae6b797f79 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 17 Sep 2012 14:09:26 +0200 Subject: [PATCH 1/2] [FIX] point_of_sale: Take the 'cash' journals if there is no specific cash journal for the Point Of Sale bzr revid: stw@openerp.com-20120917120926-h3bzu2k9ds5lnjjr --- addons/point_of_sale/point_of_sale.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 95b54b6baed..590718b48f0 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -314,9 +314,13 @@ class pos_session(osv.osv): # define some cash journal if no payment method exists if not pos_config.journal_ids: - cashids = self.pool.get('account.journal').search(cr, uid, [('journal_user', '=', True), ('type','=','cash')], context=context) + journal_proxy = self.pool.get('account.journal') + cashids = journal_proxy.search(cr, uid, [('journal_user', '=', True), ('type','=','cash')], context=context) if not cashids: - cashids = self.pool.get('account.journal').search(cr, uid, [('journal_user','=',True)], context=context) + cashids = journal_proxy.search(cr, uid, [('type', '=', 'cash')], context=context) + if not cashids: + cashids = journal_proxy.search(cr, uid, [('journal_user','=',True)], context=context) + jobj.write(cr, uid, [pos_config.id], {'journal_ids': [(6,0, cashids)]}) From 2a4aaeba31b685d5771f134ef2806d2e3dbb7a43 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 17 Sep 2012 16:01:38 +0200 Subject: [PATCH 2/2] [FIX] point_of_sale: Show/Hide some groups in function of the state and the cash_control flag bzr revid: stw@openerp.com-20120917140138-sjsnjxv27nd8rnao --- addons/point_of_sale/point_of_sale_view.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 80abb5444db..eefdcc6dd6e 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -896,8 +896,8 @@ - - + @@ -906,7 +906,8 @@ - + @@ -916,7 +917,7 @@ -
+
@@ -933,7 +934,7 @@
- +