Smile-SA / odoo_addons

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

Cannot uninstall Smile Base module #9

Open moerazem opened 9 years ago

moerazem commented 9 years ago

Hi,

After installing Smile Base. I want to uninstall it and I get:

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 941, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/odoo/addons/web/controllers/main.py", line 929, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/addons/base/module/wizard/base_module_upgrade.py", line 105, in upgrade_module
    openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/opt/odoo/.local/share/Odoo/addons/8.0/smile_upgrade/models/registry.py", line 93, in new
    registry = native_new(db_name, force_demo, status, update_module)
  File "/opt/odoo/openerp/modules/registry.py", line 370, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/openerp/modules/loading.py", line 423, in load_modules
    registry['ir.module.module'].module_uninstall(cr, SUPERUSER_ID, modules_to_remove.values())
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/addons/base/module/module.py", line 462, in module_uninstall
    ir_model_data._module_data_uninstall(cr, uid, modules_to_remove, context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 1224, in _module_data_uninstall
    ir_model_relation._module_data_uninstall(cr, uid, relation_ids, context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 648, in _module_data_uninstall
    self.unlink(cr, uid, ids, context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/api.py", line 363, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/.local/share/Odoo/addons/8.0/smile_base/models/models.py", line 84, in new_unlink
    return native_unlink(self)
  File "/opt/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/opt/odoo/openerp/models.py", line 3632, in unlink
    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 4640, in _search
    order_by = self._generate_order_by(order, query)
  File "/opt/odoo/openerp/models.py", line 4606, in _generate_order_by
    raise ValueError( _("Sorting field %s not found on model %s") %( order_field, self._name))
ValueError: Sorting field sequence not found on model ir.values
isabellerichard commented 9 years ago

Hi,

When we develop modules, we never uninstall them. I think this issue is more related to the way Odoo uninstall modules. In smile_base, we add a field sequence on model ir.values, and we define the default order for this model as _order = 'sequence, id'. I suppose that when uninstalling the module, the field is removed from the table _irvalues but the order is still set to 'sequence, id'_.

Is this a blocking issue for you ?

gustavovalverde commented 7 years ago

So, how can we uninstall the module? I'm on the same problem here.

Also, if the module can't be uninstalled, it shouldn't be autoinstall.