diff options
| author | Christophe Simonis <christophe@tinyerp.com> | 2008-12-09 14:35:40 +0100 |
|---|---|---|
| committer | Christophe Simonis <christophe@tinyerp.com> | 2008-12-09 14:35:40 +0100 |
| commit | e09455ccd8ef2af53ce8eaf17b2cde305a8fd1c0 (patch) | |
| tree | 1b93cd47a98bc674f900412333f6d6c18bf46e53 /bin/tools/convert.py | |
| parent | 822da77ee66b6d7e36ab100fa30ee8ee397c15bc (diff) | |
[FIX] psycopg2: %d -> %s
[IMP] orm: use _symbol_f when updating database at initialization
[IMP] misc.ustr: function returning the unicode string representation of a object
bzr revid: christophe@tinyerp.com-20081209133540-zlb6wxs97cxa99nx
Diffstat (limited to 'bin/tools/convert.py')
| -rw-r--r-- | bin/tools/convert.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/tools/convert.py b/bin/tools/convert.py index ee7c1c53ee8..b063c9ebabe 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -474,7 +474,7 @@ form: module.record_id""" % (xml_id,) pid = False for idx, menu_elem in enumerate(m_l): if pid: - cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem)) + cr.execute('select id from ir_ui_menu where parent_id=%s and name=%s', (pid, menu_elem)) else: cr.execute('select id from ir_ui_menu where parent_id is null and name=%s', (menu_elem,)) res = cr.fetchone() @@ -513,15 +513,15 @@ form: module.record_id""" % (xml_id,) values['icon'] = icons.get(a_type,'STOCK_NEW') if a_type=='act_window': a_id = self.id_get(cr, 'ir.actions.%s'% a_type, a_action) - cr.execute('select view_type,view_mode,name,view_id,target from ir_act_window where id=%d', (int(a_id),)) + cr.execute('select view_type,view_mode,name,view_id,target from ir_act_window where id=%s', (int(a_id),)) rrres = cr.fetchone() assert rrres, "No window action defined for this id %s !\n" \ "Verify that this is a window action or add a type argument." % (a_action,) action_type,action_mode,action_name,view_id,target = rrres if view_id: - cr.execute('SELECT type FROM ir_ui_view WHERE id=%d', (int(view_id),)) + cr.execute('SELECT type FROM ir_ui_view WHERE id=%s', (int(view_id),)) action_mode, = cr.fetchone() - cr.execute('SELECT view_mode FROM ir_act_window_view WHERE act_window_id=%d ORDER BY sequence LIMIT 1', (int(a_id),)) + cr.execute('SELECT view_mode FROM ir_act_window_view WHERE act_window_id=%s ORDER BY sequence LIMIT 1', (int(a_id),)) if cr.rowcount: action_mode, = cr.fetchone() if action_type=='tree': @@ -538,7 +538,7 @@ form: module.record_id""" % (xml_id,) values['name'] = action_name elif a_type=='wizard': a_id = self.id_get(cr, 'ir.actions.%s'% a_type, a_action) - cr.execute('select name from ir_act_wizard where id=%d', (int(a_id),)) + cr.execute('select name from ir_act_wizard where id=%s', (int(a_id),)) resw = cr.fetchone() if (not values.get('name', False)) and resw: values['name'] = resw[0] @@ -819,7 +819,7 @@ def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init', if (not line) or not reduce(lambda x,y: x or y, line) : continue try: - datas.append( map(lambda x:x.decode('utf8').encode('utf8'), line)) + datas.append(map(lambda x: misc.ustr(x), line)) except: print "ERROR while importing the line: ", line pool.get(model).import_data(cr, uid, fields, datas,mode, module,noupdate,filename=fname_partial) |
