Can not create custom field hr.employee many2one v.5.0.15
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Won't Fix
|
Low
|
Jay Vora (Serpent Consulting Services) | |||
Trunk |
Invalid
|
Undecided
|
Unassigned |
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/
result = LocalService(
File "/usr/local/
return getattr(self, method)(*params)
File "/usr/local/
res = super(recording
File "/usr/local/
res = service.execute(db, uid, object, method, *args)
File "/usr/local/
return f(self, dbname, *args, **kwargs)
File "/usr/local/
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/local/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/local/
return super(ir_
File "/usr/local/
result += self._columns[
File "/usr/local/
id_new = obj.create(cr, user, act[2], context=context)
File "/usr/local/
self.
File "/usr/local/
cr.
File "/usr/local/
return f(self, *args, **kwargs)
File "/usr/local/
res = self._obj.
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!
Hello Tanel,
Thanks for the bug report.
I would say, this is not a bug, it comes due to wrong configuration. You could have selected 'set null' here.
Anyways, the actual problem resides in the selection widget of web client. The selection widget adds a blank option to the 'not required' selection field's select list. Thus making an additional '' to the selection.
I have attached a patch which makes you get rid of this problem.
We won't accept it as a bug for 5.0,this has been well managed in version 6.0.
Thanks for understanding and thanks for your patience.