[IMP] Use get_by_record method of ir.property

This commit is contained in:
Adrien Peiffer
2014-11-28 09:06:54 +01:00
parent 89a1bc710a
commit 69dd10dea9

View File

@@ -272,12 +272,10 @@ class wizard_update_charts_accounts(orm.TransientModel):
if property_ids:
prop = property_obj.browse(
cr, uid, property_ids[0], context=context)
account_id = len(prop.value_reference.split(',')) == 2 and\
int(prop.value_reference.split(',')[1]) or False
if account_id:
code = account_obj.read(
cr, uid, account_id, ['code'], context)['code']
number_digits = len(code)
account = property_obj.get_by_record(cr, uid, prop,
context=context)
if account:
number_digits = len(account.code)
return number_digits
_defaults = {