Name_search based on context don't work in o2m
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Web Client |
Fix Released
|
Undecided
|
Amit Mendapara |
Bug Description
Name_search based on context don't work in o2m field.
If you add context tag on a tree view in o2m filed, this context is not pass to the name_search function. This is bad, cause it' very useful. You can for exemple make a filter on "activity" based on selected "account" in the line...
An exemple:
Here the field view definition in the tree part of o2m:
<field name="activity" context=
Here the name search of activity object:
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80):
if not args:
args=[]
acc_ids=[]
if context.
account_
#take the account wich have activity_ids
acc_
if acc_who_matters:
for i in acc_who_
acc_
if not context:
context={}
account = self.search(cr, uid, [('code', '=', name),(
if not account:
account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name),(
if not account:
account = self.search(cr, uid, [('id',
return self.name_get(cr, uid, account, context=context)
Changed in openobject-client-web: | |
status: | In Progress → Fix Committed |
Changed in openobject-client-web: | |
status: | Fix Committed → Fix Released |
This mehtode of context definition doesn't work also:
<field name="activity" context= "{'account_ id': account_id}" />