From deff44edbdd3d120c478085cfdbcebb8fbc193ba Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 7 Dec 2011 18:54:45 +0100 Subject: [PATCH] [Usability] Now tells the user in the error message which account triggers the error bzr revid: alexis@via.ecp.fr-20111207175445-dav09ybjdhzpilyl --- addons/account/account_move_line.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 55e154e..e9a5e32 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -581,14 +581,14 @@ class account_move_line(osv.osv): lines = self.browse(cr, uid, ids, context=context) for l in lines: if l.account_id.type == 'view': - return False + raise osv.except_osv(_('Error :'), _('You can not create move line on view account %s %s') % (l.account_id.code, l.account_id.name)) return True def _check_no_closed(self, cr, uid, ids, context=None): lines = self.browse(cr, uid, ids, context=context) for l in lines: if l.account_id.type == 'closed': - return False + raise osv.except_osv(_('Error :'), _('You can not create move line on closed account %s %s') % (l.account_id.code, l.account_id.name)) return True def _check_company_id(self, cr, uid, ids, context=None): -- 1.7.10.4