diff options
| author | cpa-openerp <cpa@tinyerp.com> | 2012-04-04 18:42:46 +0530 |
|---|---|---|
| committer | cpa-openerp <cpa@tinyerp.com> | 2012-04-04 18:42:46 +0530 |
| commit | 919797328cd064bc5a67009d3bc6ce8f8a7aec45 (patch) | |
| tree | 04e61ff9e8297dcbd3e9bdbd96c2ac9f2d3ccad3 | |
| parent | c3501275b38a9aef85f949f4ed3608b7a9077b9d (diff) | |
[FIX] Fixed unicode string not convert in id.
bzr revid: cpa@tinyerp.com-20120404131246-kw85tu00ufgm6277
| -rw-r--r-- | addons/account/account_move_line.py | 13 |
1 files 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): |
