python - How to uninstall manually openerp module -


i have installed module on openerp v7 uninstall.

using interface fails, error during uninstall process.

is there 'manual' way uninstall module ? sufficient remove module folder under addons/ or there other things do, make in cleanest way ?

here error when try uninstall module through 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 long trace..

at first suspected 1 of xml files wrong, same error when try install module manually, think else going wrong can't see what.

cheers

removing module's code addons/is not enough - break openerp.

solution 1 - try resolve error have during normal uninstall

this method recommended because openerp job cleanly. @ error have during uninstallation , try imagine problem. post error trace here further help.

solution 2 - manual uninstall

my procedure based on openerp v6.0 should similar in openerp v7.

  1. backup database :). it. it's probable break during procedure.

  2. find records created during installation or update of module.

    • look @ __openerp__.py see xml files taken account when installing , updating module. alternatively, consider xml files in module's directories.

    • search records created modules during install or update. there should xml elements <record ...model='...'> inside these files. model attribute tells in datatable record resides. if using unix-like system, can try following command in module's root directory:

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

  3. delete these records. you'll use database interface tool such pgadmin or pqsl , find records discovered in previous step.

    for example, following xml line defines record in ir_cron datatable:

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

    knowing that, can find record based on data defined record in xml file.

  4. find , delete menu items defined module. above, search xml files <menuitem ...> elements. related records in ir_ui_menu datatable.

  5. discover models defined module. try following command:

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

    only pay attention models defined in objects derive osv.osv (osv.model in openerp v7). define persistent models stored in database. objects descendant osv.osv_memory (osv.transientmodel in v7) not stored in database.

    be careful , avoid deleting models defined in parent objects. @ _inherit property of object give idea that. in case, want delete columns added module.

    once discover models defined module, try delete corresponding datatables. example, model

    _name = "bg_vat.bg_vat"

    will have corresponding table in database named 'bg_vat_bg_vat'.

  6. finally, remove or deactivate module. record corresponding module in ir_module_module datatable. can delete record or set state field uninstalled.

    if like, can delete module's directory addons don't see reason this.

i'm sure missed cleaning actions (like records in ir_model* datatable family). i'm pretty sure procedure can break openerp installation. make backup first. :)


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -