Replacing a partner column with an unstored function field makes OpenERP crash at module upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
What I'm trying to do
-------
Very simple use case here: replacing the 'street' field on the partner model by separate fields for street name and house number. We want to make 'street' a function field that returns a concatenation of both, for compatibility with the rest of the system. Storing such a field has a performance impact, and is unnecessary for our purposes.
What goes wrong
-------
This is all working as expected, until I update any module except 'base' (or 'all'). This gives the following error:
2013-11-20 18:29:09,913 20442 DEBUG dbname openerp.
2013-11-20 18:29:10,599 20442 ERROR dbname openerp.sql_db: Programming error: column res_partner.street does not exist
LINE 1: ...s_partner.
, in query SELECT res_partner.
zip",res_
ner."customer"
rtner."
2013-11-20 18:29:10,599 20442 DEBUG dbname openerp.
2013-11-20 18:29:10,599 20442 ERROR dbname openerp.sql_db: bad query: SELECT res_users.
es_users.
BY id
Here is the relevant part of the backtrace:
/path/
-> modobj.
/path/
-> self.button_
/path/
-> return dict(ACTION_DICT, name=_('Install'))
/path/
-> lang = self._get_
/path/
-> lang = pool.get(
/path/
-> r = self.lookup(self2, cr, *args)
/path/
-> value = d[key] = self.method(self2, cr, *args)
/path/
Analysis:
-----------
Very early in the upgrade process, fetching a translation triggers res_users:
Proposed solution:
-------
Don't browse, but perform a read on the relevant fields. This limits the impact of the matter to only those fields.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 52 lines (+16/-11)2 files modifiedopenerp/addons/base/res/res_partner.py (+6/-1)
openerp/addons/base/res/res_users.py (+10/-10)