From 69dd10dea9c32e20677e13123c7f4ac8633161ed Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Fri, 28 Nov 2014 09:06:54 +0100 Subject: [PATCH] [IMP] Use get_by_record method of ir.property --- account_chart_update/wizard/wizard_chart_update.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index ad53536be..7064e22e9 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -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 = {