search() is not called when name_search() not defined
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D |
Bug Description
Hi,
I face an issue with search() method. Let me take an example for more clear. There are 2 classes: A, B
===
class A(osv.osv):
def search():
return super(A, self).search(....)
A()
class B(osv.osv):
_columns = {
a_id: many2one('A')....
}
B()
===
Now, I open the form of model B and edit it, I choose a value of a_id. A.search() is not executed.
But if I define name_search() for A as follow:
===
def name_search():
self.
return self.name_get(cr, uid, ids, context=context)
===
Then A.search() is executed due to explicit called by self.search() inside name_get().
This is actual issue when I do some customizations on search of A. For example, I define a domain for a_id as [('code'
After many tests, I see that search() of a model must be called explicit through other methods (name_get() here), otherwise it will fail, can't do any customizations on domain search.
I think that orm should call search() overriden method of model at any time. my above tests show that orm calls search() of osv.osv.
Thanks,
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Low |
status: | New → Confirmed |