[FIX] Check if account_id if present
authorStephane Wirtel <stephane@tinyerp.com>
Thu, 18 Dec 2008 14:39:05 +0000 (15:39 +0100)
committerStephane Wirtel <stephane@tinyerp.com>
Thu, 18 Dec 2008 14:39:05 +0000 (15:39 +0100)
lp bug: https://launchpad.net/bugs/309337 fixed

bzr revid: stephane@tinyerp.com-20081218143905-uwv9umr7mss0dlb9

addons/account/account_move_line.py

index 233eaf8..f32d150 100644 (file)
@@ -466,7 +466,7 @@ class account_move_line(osv.osv):
                     val['account_id'] =  id2
                 elif jt=='purchase':
                     val['account_id'] =  id1
-                if val['account_id']:
+                if val.get('account_id', False):
                     d = self.onchange_account_id(cr, uid, ids, val['account_id'])
                     val.update(d['value'])
         return {'value':val}