[FIX] context usage (context may be None in _default_value), dict.get (no need for a False default value in a conditional)
bzr revid: xmo@openerp.com-20111010081021-ijcuchd53dbdr9lc
This commit is contained in:
parent
26140ce8f4
commit
8a5314b15e
|
@ -100,12 +100,14 @@ class res_partner_bank(osv.osv):
|
|||
return result
|
||||
|
||||
def _default_value(self, cursor, user, field, context=None):
|
||||
if context is None: context = {}
|
||||
if field in ('country_id', 'state_id'):
|
||||
value = False
|
||||
else:
|
||||
value = ''
|
||||
if not context.get('address', False):
|
||||
if not context.get('address'):
|
||||
return value
|
||||
|
||||
for _, id, address_data in context['address']:
|
||||
if not (id or address): continue
|
||||
address = {}
|
||||
|
|
Loading…
Reference in New Issue