Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Advance Search hide field Error:

By
dirtyHandsPHP
on 9/12/15, 1:48 PM 625 views

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.

Bista Solutions US, Ray Carnes
on 9/12/15, 2:20 PM

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

dirtyHandsPHP
on 9/12/15, 2:35 PM
0

I would like to let you know that this piece of code is working fine and producing desired output without any errors. Kindly provide more details on your issue(as you said it is working properly on your local machine).

Hi @Nepro: Thanks for your answer. Did you try to add new contact in this environment?

dirtyHandsPHP
on 9/20/15, 8:51 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/12/15, 1:48 PM
Seen: 625 times
Last updated: 9/14/15, 2:48 AM