Hi,
In Customers section I want to hide 'Active' field from Advance Search drop-down. I was able to do it successfully using following link code:
http://www.nevprobusinesssolutions.com/hide-fields-in-advanced-search/
But now this code is not allowing me to create new contact and showing
me the following error.
Can anyone please help me to fix this.
Note: It's working fine on my local environment.
ERROR
====================================================================================
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/http.py", line 300, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo-server/openerp/http.py", line 796, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo-server/openerp/http.py", line 396, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 936, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 928, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/custom/addons/askey_base/partner.py", line 42, in create
res=super(res_partner, self).create(cr, uid, vals)
File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/custom/addons/base_phone/base_phone.py", line 254, in create
cr, uid, vals_reformated, context=context)
File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/api.py", line 336, in old_api
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/addons/base/res/res_partner.py", line 573, in create
partner = super(res_partner, self).create(vals)
File "/opt/odoo/odoo-server/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/api.py", line 462, in new_api
result = method(self._model, cr, uid, *args, **kwargs)
File "/opt/odoo/odoo-server/addons/mail/mail_thread.py", line 405, in create
tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), context=track_ctx)
File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo-server/addons/mail/mail_thread.py", line 480, in _get_tracked_fields
return self.fields_get(cr, uid, tracked_fields, context=context)
File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/custom/addons/askey_base/partner.py", line 72, in fields_get
res[field]['selectable'] = False
KeyError: 'active'
Active is a field used by Odoo to determine which records to normally show. Making it unselectable to users also makes it unselectable to Odoo. What is the business problem or use case you are trying to implement? Perhaps there is another way.
Hey Ray..thanks for quick reply. In Advance Search there is one field named 'Active' (active in res_partner table). I want to hide it from all the users other than Admin. When i used above link it's giving me error posted above...kindly check