From f3b050a4a7b03d5b210f1902787a0d6dc6a85fd3 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 11:25:58 +0530 Subject: [PATCH] [FIX] Account : Only those accounts are eligible to be Parents which have type=View bzr revid: gpa@tinyerp.com-20100511055558-31b0nt9c7bmh47ye --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index da82baec541..17e753b4352 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -295,7 +295,7 @@ class account_account(osv.osv): 'user_type': fields.many2one('account.account.type', 'Account Type', required=True, help="These types are defined according to your country. The type contains more information "\ "about the account and its specificities."), - 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), + 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids': fields.one2many('account.account','parent_id','Children'), 'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'), 'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"),