[FIX] Define the local variable 'res'

bzr revid: stephane@openerp.com-20100602130625-0xl1sqo57h6f0kue
This commit is contained in:
Stephane Wirtel 2010-06-02 15:06:25 +02:00
parent 07ad499af4
commit d497f5c6e9
1 changed files with 3 additions and 4 deletions

View File

@ -1965,13 +1965,12 @@ class account_add_tmpl_wizard(osv.osv_memory):
if not tids or not tids[0]['parent_id']:
return False
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]],['code'])
res = None
if not ptids or not ptids[0]['code']:
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
res = acc_obj.search(cr,uid,[('code','=',ptids[0]['code'])])
if res:
return res[0]
else:
return False
return res and res[0] or False
_columns = {
'cparent_id':fields.many2one('account.account', 'Parent target', help="Creates an account with the selected template under this existing parent.", required=True),