From 919797328cd064bc5a67009d3bc6ce8f8a7aec45 Mon Sep 17 00:00:00 2001 From: cpa-openerp Date: Wed, 4 Apr 2012 18:42:46 +0530 Subject: [PATCH] [FIX] Fixed unicode string not convert in id. bzr revid: cpa@tinyerp.com-20120404131246-kw85tu00ufgm6277 --- addons/account/account_move_line.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index c6182d9e61b..cb10535dba4 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -202,13 +202,12 @@ class account_move_line(osv.osv): context = {} period_obj = self.pool.get('account.period') #check if the period_id changed in the context from client side - if context.get('period_id', False): - period_id = context.get('period_id') - if type(period_id) == str: - ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)]) - context.update({ - 'period_id': ids[0] - }) + period_id = context.get('period_id', False) + if period_id and isinstance(period_id, basestring): + ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)]) + context.update({ + 'period_id': ids[0] + }) return context def _default_get(self, cr, uid, fields, context=None):