Smile-SA / odoo_addons

Odoo addons developed by Smile
GNU Affero General Public License v3.0
287 stars 308 forks source link

Error when uninstalling Access Control #8

Open moerazem opened 9 years ago

moerazem commented 9 years ago

Hi,

I install Access Control module for a test. I then uninstalled it and i get this error:

Traceback (most recent call last):
  File "/opt/odoo/openerp/http.py", line 536, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/openerp/http.py", line 573, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/openerp/http.py", line 309, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/openerp/http.py", line 306, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/openerp/http.py", line 802, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/openerp/http.py", line 402, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/web/controllers/main.py", line 877, in search_read
    return self.do_search_read(model, fields, offset, limit, domain, sort)
  File "/opt/odoo/addons/web/controllers/main.py", line 898, in do_search_read
    request.context)
  File "/opt/odoo/openerp/http.py", line 907, in proxy
    result = meth(cr, request.uid, *args, **kw)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/models.py", line 5129, in search_read
    record_ids = self.search(cr, uid, domain or [], offset=offset, limit=limit, order=order, context=context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/models.py", line 1642, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/models.py", line 4638, in _search
    query = self._where_calc(cr, user, args, context=context)
  File "/opt/odoo/.local/share/Odoo/addons/8.0/smile_web_search_timedelta/models.py", line 57, in _where_calc
    return native_where_calc(self, cr, uid, domain, active_test, context)
  File "/opt/odoo/.local/share/Odoo/addons/8.0/smile_web_search_range/models.py", line 37, in _where_calc
    return native_where_calc(self, cr, uid, new_domain, active_test, context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/models.py", line 4461, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/opt/odoo/openerp/osv/expression.py", line 646, in __init__
    self.parse(cr, uid, context=context)
  File "/opt/odoo/openerp/osv/expression.py", line 812, in parse
    raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'user_profile' in leaf "<osv.ExtendedLeaf: ('user_profile', '=', False) on res_users (ctx: )>"
isabellerichard commented 9 years ago

Hi,

In the module base, the action window _base.action_resusers has no value defined for the field domain. In smile_access_control, we set a value for this field on this record. Uninstalling a module don't empty fields which were not set, so you have to manually update the action window to empty the field domain.

askz commented 8 years ago

Hi, I had the same issue and get field domain empty as you said, Now the problem is that the user form view is limited, I have access to only few parameters now, like just phone and e-mail...

isabellerichard commented 8 years ago

Hi,

That's another problem caused by uninstallation... In smile_access_control, we override native actions of module base:

    <record id="base.action_res_users" model="ir.actions.act_window">
      <field name="domain">[('user_profile', '=', False)]</field>
    </record>
    <record id="base.action_res_users_view2" model="ir.actions.act_window.view">
      <field name="view_id" ref="view_res_user_form"/>
    </record>

When you uninstall, the view smile_access_control.view_res_user_form is deleted, so the "view_id" of the action can't be found anymore. Odoo search the first form view for res.users and he opens it. You can edit this action and assign "view_id" with the view "res.users.form" (base.view_users_form).

askz commented 8 years ago

Hi, Thanks for your answer, I set the view_id according to your answer and the problem's still here..!

olubiyiontheweb commented 5 years ago

Under developer tools,

Go to technical in settings,

windows actions --> then filter name by users.

you will find user_profile in actions, remove the domain value and you'll be fine.