unicode problem on account module

Bug #1037923 reported by Jacara
This bug report is a duplicate of:  Bug #943359: Error on view journal items. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

I have account period with unicode such as "5-р сар.2012".

But convert_to_period method on account.move.line does not support unicode data. This is bug.

def convert_to_period(self, cr, uid, context=None):
        if context is None:
            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]
                })
        return context

If i search period and journal on journal item display then getting errors.

File "/openerp/addons/account/account_move_line.py", line 958, in view_header_get
    cr.execute('SELECT code FROM account_period WHERE id = %s', (context['period_id'], ))
  File "/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
DataError: invalid input syntax for integer: "5-р сар.2012"
LINE 1: SELECT code FROM account_period WHERE id = '5-р сар.2012'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.