[REF]account:improve message string

bzr revid: ara@tinyerp.com-20110111063642-ywa2c47xgqtkxazp
This commit is contained in:
ARA (OpenERP)
2011-01-11 12:06:42 +05:30
parent 8db70a6911
commit facafa1ed9
+4 -4
View File
@@ -424,13 +424,13 @@ class account_account(osv.osv):
context = {}
accounts = self.browse(cr, uid, ids, context=context)
for account in accounts:
if account.parent_id.type != 'view' and account.parent_id:
if account.parent_id and account.parent_id.type != 'view':
return False
return True
_constraints = [
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']),
(_check_type, 'You cannot create a account! \nMake sure if the account has parent it should be type "View"! ', ['parent_id']),
(_check_type, 'You cannot create a account! \nMake sure if the account has parent then it should be type "View"! ', ['parent_id']),
]
_sql_constraints = [
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
@@ -2310,14 +2310,14 @@ class account_account_template(osv.osv):
context = {}
accounts = self.browse(cr, uid, ids, context=context)
for account in accounts:
if account.parent_id.type != 'view' and account.parent_id:
if account.parent_id and account.parent_id.type != 'view':
return False
return True
_check_recursion = check_cycle
_constraints = [
(_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id']),
(_check_type, 'You cannot create a account template! \nMake sure if the account template has parent it should be type "View"! ', ['parent_id']),
(_check_type, 'You cannot create a account template! \nMake sure if the account template has parent then it should be type "View"! ', ['parent_id']),
]