Comment 3 for bug 849887

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: Editing of custom m2m field in Object raise an error

I confirm that on latest trunk (rev. 4072) trying to rename a custom m2m column does not work and causes the following traceback. However the importance of this bug should be corrected, it is at best a Low priority issue, and rather a Wishlist.
Renaming of custom columns is experimental, especially for many2many fields. The fix might involve returning a clear error message that explains this is not supported, and the custom column should instead be dropped and re-added.

Server Traceback (most recent call last):
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/addons/web/common/http.py", line 592, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/service/web_services.py", line 572, in dispatch
    res = fn(db, uid, *params)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/addons/audittrail/audittrail.py", line 495, in execute_cr
    return fct_src(cr, uid, model, method, *args)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/addons/base/ir/ir_model.py", line 153, in write
    return super(ir_model,self).write(cr, user, ids, vals, context)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/orm.py", line 3920, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/osv/fields.py", line 567, in set
    obj.write(cr, user, [act[1]], act[2], context=context)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/addons/base/ir/ir_model.py", line 400, in write
    cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % column_rename[1])
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-trunk-3243/server/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
ProgrammingError: column "x_test_ids" does not exist