c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #07064
[Bug 686795] Re: Can not create custom field hr.employee many2one v.5.0.15
** Changed in: openobject-addons/trunk
Status: New => Invalid
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/686795
Title:
Can not create custom field hr.employee many2one v.5.0.15
Status in OpenObject Addons Modules:
Invalid
Status in OpenObject Addons 5.0 series:
New
Status in OpenObject Addons trunk series:
Invalid
Bug description:
I describe how you can reproduce that bug step by step. Tested with 3 computers. 2 Linux and 1 Win.
So lets start.
1. Open in Openerp-Web
CRM & SRM ->After-Sale Services->Bug Tracking->New Bug
2. Now lets make new custom field "Employee"
[CUSTOMISE]-> CUSTOMISE OBJECT-> Create new record.
3. Lets fill that new record.
Name: x_employee_id
Field Label: Employee
Field Type: many2one
Object Relation: hr.employee
On delete: (clear, remove Set NULL)
4. Press button "Save" and u see results:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 299, in dispatch
result = LocalService(service_name)(method, *params)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 77, in __call__
return getattr(self, method)(*params)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base_module_record/base_module_record.py", line 38, in execute
res = super(recording_objects_proxy, self).execute(*args, **argv)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 577, in execute
res = service.execute(db, uid, object, method, *args)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 58, in wrapper
return f(self, dbname, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 119, in execute
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 111, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/ir/ir_model.py", line 77, in write
return super(ir_model,self).write(cr, user, ids, vals, context)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 2679, in write
result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/fields.py", line 446, in set
id_new = obj.create(cr, user, act[2], context=context)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base/ir/ir_model.py", line 271, in create
self.pool.get(vals['model'])._auto_init(cr, ctx)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 1866, in _auto_init
cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (self._table, k, ref, f.ondelete))
File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 78, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 123, in execute
res = self._obj.execute(query, params)
ProgrammingError: syntax error at or near "None"
LINE 1: ...EY ("x_employee_id") REFERENCES "hr_employee" ON DELETE None
^
NOTICE: If you not see that bug then please make new database and try again. I noticed when i first put something else when hr.employee and save and then replace it with hr.employee then bug dis asper!
So create NEW database and you see that bug 100%.
Another notice. If you once reproduced that bug you can not use many2one anymore at all! Always is result crash!
References