openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #07850
[Bug 849887] 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
** Changed in: openobject-server
Importance: Medium => Wishlist
** Changed in: openobject-server
Status: Incomplete => Confirmed
** Summary changed:
- Editing of custom m2m field in Object raise an error
+ Renaming custom m2m fields is not supported
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/849887
Title:
Renaming custom m2m fields is not supported
Status in OpenERP Server:
Confirmed
Bug description:
To reproduce the issue follow the given steps :
1). Create a object x_product.material with one char field
2). Create a m2m field x_material_id in product.product object with object reference to x_product.material and save it.
3). Edit the m2m x_material_id column name
It raise the following error.
[2011-09-14 15:30:11,081][16933] ERROR:db.cursor:Programming error: column "x_material_id" does not exist
, in query ALTER TABLE "product_product" RENAME COLUMN "x_material_id" TO "x_dsdfsd_id"
[2011-09-14 15:30:11,081][16933] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/osv/osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/osv/osv.py", line 167, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/addons/base/ir/ir_model.py", line 144, in write
return super(ir_model,self).write(cr, user, ids, vals, context)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/osv/orm.py", line 3438, in write
result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/osv/fields.py", line 505, in set
obj.write(cr, user, [act[1]], act[2], context=context)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/addons/base/ir/ir_model.py", line 381, in write
cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % column_rename[1])
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/sql_db.py", line 78, in wrapper
return f(self, *args, **kwargs)
File "/home/ado/Desktop/6.0/stable-6/openobject-server/bin/sql_db.py", line 131, in execute
res = self._obj.execute(query, params)
ProgrammingError: column "x_material_id" does not exist
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/849887/+subscriptions