How to uninstall manually openerp module

renard

I have installed a module on openerp v7 that I would like to uninstall.

Using the interface fails, i get an error during the uninstall process.

Is there a 'manual' way to uninstall a module ? Is it sufficient to remove the module folder under addons/ or is there any other things to do, to make it in the cleanest way ?

Here is the error I get when i try to uninstall a module through the interface:

Client Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/controllers/main.py", line 1132, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/session.py", line 42, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid,     self.session._password, self.model, method, args, kw)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/session.py", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/session.py", line 103, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)


Server Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/base/module/module.py", line 495, in button_immediate_uninstall
    return self._button_immediate_function(cr, uid, ids, self.button_uninstall,     context=context)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/addons/base/module/module.py", line 475, in _button_immediate_function
    _, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/pooler.py", line 39, in restart_pool
    registry = RegistryManager.new(db_name, force_demo, status, update_module)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/loading.py", line 354, in load_modules
    loaded_modules, update_module)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/loading.py", line 256, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report,     skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/loading.py", line 188, in load_module_graph
    load_data(module_name, idref, mode)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/loading.py", line 76, in <lambda>
    load_data = lambda *args: _load_data(cr, *args, kind='data')
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-    py2.7.egg/openerp/modules/loading.py", line 124, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20131016_232725-py2.7.egg/openerp/tools/convert.py", line 945, in convert_xml_import
    relaxng.assert_(doc)
  File "lxml.etree.pyx", line 3027, in lxml.etree._Validator.assert_     (src/lxml/lxml.etree.c:129517)
AssertionError: Did not expect text in element record content, line 33

Sorry for this long trace..

At first I suspected one of the xml files to wrong, but as I get the same error when I try to install a module manually, I think something else is going wrong but I can't see what.

Cheers

Andrei Boyanov

Removing the module's code from addons/is not enough - this will break OpenERP.

Solution 1 - Try to resolve the error you have during normal uninstall

This method is recommended because OpenERP does the job cleanly. Look at the error you have during uninstallation and try to imagine what could be the problem. Post the error trace here for further help.

Solution 2 - Manual uninstall

My procedure is based on OpenERP v6.0 but it should be very similar in OpenERP v7.

  1. Backup your database :). Do it. It's very probable that you break something during this procedure.

  2. Find what records were created during the installation or the update of the module.

    • Look at __openerp__.py to see which XML files are taken into account when installing and updating the module. Alternatively, consider all XML files in the module's directories.

    • Search for records created by this modules during install or update. There should be XML elements like <record ...model='...'> inside these files. The model attribute tells you in which datatable the record resides. If you are using a Unix-like system, you can try the following command in the module's root directory:

    grep -r -n -A 5 --include="*.xml" \<record *

  3. Delete these records. You'll use some database interface tool such as PgAdmin or pqsl and find the records discovered in the previous step.

    For example, the following XML line defines a record in the ir_cron datatable:

    <record model="ir.cron" id="ir_cron_account_fiscalyear_close">

    Knowing that, you can find the record based on the data defined for this record in the XML file.

  4. Find and delete all the menu items defined by the module. As above, search the XML files for <menuitem ...> elements. Look for related records in the ir_ui_menu datatable.

  5. Discover which models were defined by the module. Try the following command:

    grep -r -n -C 5 --include="*.py" "_name = " *

    Only pay attention to models defined in objects that derive from osv.osv (osv.Model in OpenERP v7). They define persistent models stored in the database. Objects descendant from osv.osv_memory (osv.TransientModel in v7) are not stored in the database.

    Be careful and avoid deleting models defined in parent objects. Look at the _inherit property of the object to give you an idea about that. In this case, you want to only delete the columns added by your module.

    Once you discover the models defined by your module, try to delete the corresponding datatables. For example, the model with

    _name = "bg_vat.bg_vat"

    will have a corresponding table in the database named 'bg_vat_bg_vat'.

  6. Finally, remove or just deactivate the module. Look for a record corresponding to your module in ir_module_module datatable. You can delete the record or just set the state field to uninstalled.

    If you like, you can now delete the module's directory from addons but I don't see a reason to do this.

I'm sure I missed some cleaning actions (like the records in the ir_model* datatable family). I'm also pretty sure this procedure can easily break your OpenERP installation. Make a backup first. :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to uninstall manually openerp module

From Dev

How to uninstall a snap package manually?

From Dev

How to uninstall MongoDB that was manually installed

From Dev

OpenERP 7 How to give users access to custom module in OpenERP 7?

From Dev

How do you uninstall manually installed Eclipse?

From Dev

How to uninstall manually installed java? (jdk 8)

From Dev

How can I manually uninstall Wine

From Dev

How to delete a menuitem in openerp from a customized module

From Dev

difference between openerp module and openerp web module

From Dev

How do I manually uninstall PIL from OSX (snow leopard)

From Dev

how to update latest version of without uninstall older application manually

From Dev

Joomla 3: How to uninstall module from a package?

From Dev

How to install/uninstall/update a homemade Python module?

From Dev

How to find popup box code in hr module in openerp?

From Dev

Odoo 8.0 (OpenERP) Creating Custom Module - How to save data to model?

From Dev

OpenERP : how to add access to module installed in menu bar

From Dev

how to convert amount to text in openerp 7 in Accounting and Finance module?

From Dev

How do i install an openerp module from backend

From Dev

inheritance of customized module in openerp

From Dev

How to add a custom fields created in Employee Module to Leave Request Module in openerp 8?

From Dev

Can not import customize module in openERP

From Dev

OpenERP customized module with button object

From Dev

Bug with openerp new module XML

From Dev

Can not import customize module in openERP

From Dev

OpenERP - Error: No module named Image

From Dev

How do I uninstall a powershell module from my computer?

From Dev

DNN module uninstall how to remove settings from web.config

From Dev

DNN module uninstall how to remove settings from web.config

From Dev

How to manually uninstall VMware Workstation 9 on Windows 7 Enterprise x64 PC?

Related Related

  1. 1

    How to uninstall manually openerp module

  2. 2

    How to uninstall a snap package manually?

  3. 3

    How to uninstall MongoDB that was manually installed

  4. 4

    OpenERP 7 How to give users access to custom module in OpenERP 7?

  5. 5

    How do you uninstall manually installed Eclipse?

  6. 6

    How to uninstall manually installed java? (jdk 8)

  7. 7

    How can I manually uninstall Wine

  8. 8

    How to delete a menuitem in openerp from a customized module

  9. 9

    difference between openerp module and openerp web module

  10. 10

    How do I manually uninstall PIL from OSX (snow leopard)

  11. 11

    how to update latest version of without uninstall older application manually

  12. 12

    Joomla 3: How to uninstall module from a package?

  13. 13

    How to install/uninstall/update a homemade Python module?

  14. 14

    How to find popup box code in hr module in openerp?

  15. 15

    Odoo 8.0 (OpenERP) Creating Custom Module - How to save data to model?

  16. 16

    OpenERP : how to add access to module installed in menu bar

  17. 17

    how to convert amount to text in openerp 7 in Accounting and Finance module?

  18. 18

    How do i install an openerp module from backend

  19. 19

    inheritance of customized module in openerp

  20. 20

    How to add a custom fields created in Employee Module to Leave Request Module in openerp 8?

  21. 21

    Can not import customize module in openERP

  22. 22

    OpenERP customized module with button object

  23. 23

    Bug with openerp new module XML

  24. 24

    Can not import customize module in openERP

  25. 25

    OpenERP - Error: No module named Image

  26. 26

    How do I uninstall a powershell module from my computer?

  27. 27

    DNN module uninstall how to remove settings from web.config

  28. 28

    DNN module uninstall how to remove settings from web.config

  29. 29

    How to manually uninstall VMware Workstation 9 on Windows 7 Enterprise x64 PC?

HotTag

Archive