models inheriting by prototype (_inherit with different _name) do not get updated when parent model is modified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D |
Bug Description
Workarounds
===========
- In all cases, forcing a manual module update of the module in which the error occurs will take care of the error permanently. For example the error can occur if you install `base_contact` after installing `crm`. As the error message pops up when you are trying to use crm leads, forcing a manual update of the `crm` module will fix the error (by creating the missing columns)
- If the error happens in a custom module, you could also avoid it by making an explicit dependency on the other module that is causing the error to happen. In the previous example, the error would be avoided if `crm` had an explicit dependency on `base_contact`, because base_contact would always be installed and loaded *before* `crm`.
Original Description
=======
openobject-
Steps:
1 - Install 'crm' module
2 - Make a module that adds a field to 'res.partner.
3 - Try to create a new lead
you get:
[2011-06-19 14:16:01,056][test] ERROR:db.
LINE 1: SELECT crm_lead.
, in query SELECT crm_lead.
[2011-06-19 14:16:01,057][test] ERROR:web-
Traceback (most recent call last):
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
self.
File "/home/
result = self._columns[
File "/home/
res = self._fnct(obj, cr, user, ids, name, self._arg, context)
File "/home/
if lead.date_closed:
File "/home/
return self[name]
File "/home/
fields_to_fetch = filter(lambda x: x[1]._classic_
File "/home/
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/
cr.
File "/home/
return f(self, *args, **kwargs)
File "/home/
res = self._obj.
ProgrammingError: column crm_lead.last_name does not exist
LINE 1: SELECT crm_lead.
This is because 'crm.lead' inherits 'res.partner.
Investigating, I noticed that at line 194
http://
'self._
Changed in openobject-server: | |
status: | Confirmed → In Progress |
Changed in openobject-server: | |
status: | In Progress → Confirmed |
summary: |
- Error reading fields of an object inherited by prototyping + models inheriting by prototype (_inherit with different _name) do not + get updated when parent model is modified |
description: | updated |
Hello Lorenzo,
I have checked your issue but did not face any problem like this bug description.
would you please check this with respect of addons module only and provide me the proper test case which raises the same traceback.
Thanks and waiting for your reply.