ir.model.field copy is impossible (in most cases)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
If a field('
Then when you call the function copy() on an 'ir.model.fields', it will call the create function with a 'vals' dictionnary containing the field 'relation' containing 'NULL' and this check will fail:
if 'relation' in vals and not self.pool.
Indeed, the model named 'NULL' does not exist. Overloading the copy function using a 'default' dictionnary is not even a solution because setting 'relation' to False will only give a different error: now the model False does not exist.
So modifying the check to:
if vals.get(
seems a good (and harmless) thing to do in order to give the possibility to use the copy function with a default dictionnary.
And setting the default value of relation to '' instead of 'NULL' seems like a cleaner solution (but I'm not sure this 'NULL' value is not used somewhere else...)
Related branches
Changed in openobject-server: | |
status: | New → Confirmed |
Changed in openobject-server: | |
status: | Confirmed → In Progress |
Fixed by revision 2036 <email address hidden>.
Thanks for your interest.