今天安装了一个odoo模块,然后就悲剧的发现,odoo运行不起来了, 咋办呢?
odoo运行不起来,想卸载都没办法,还好,odoo提供了一个命令行的方式来卸载
(venv) PS D:\BaiduSyncdisk\odoo\odoo16> python odoo-bin shell -c odoo.conf
......
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(Console)
>>>
>>> self.env['ir.module.module'].search([('name', 'like', '需要卸载的模块名')]).button_immediate_uninstall()
卸载成功!
>>> self.env['ir.module.module'].search([('name', 'like', 'treegrid')]).button_immediate_uninstall()
2023-09-09 06:15:51,272 26524 INFO odoo2 odoo.addons.base.models.ir_module: ALLOW access to module.button_immediate_uninstall on ['treegrid'] to user __system__ #1 via n/a
2023-09-09 06:15:51,273 26524 INFO odoo2 odoo.addons.base.models.ir_module: User #1 triggered module uninstallation
2023-09-09 06:15:51,273 26524 INFO odoo2 odoo.addons.base.models.ir_module: ALLOW access to module.button_uninstall on ['treegrid'] to user __system__ #1 via n/a
2023-09-09 06:15:51,287 26524 INFO odoo2 odoo.modules.loading: loading 1 modules...
2023-09-09 06:15:51,294 26524 INFO odoo2 odoo.modules.loading: 1 modules loaded in 0.01s, 0 queries (+0 extra)
2023-09-09 06:15:51,320 26524 INFO odoo2 odoo.modules.loading: updating modules list
2023-09-09 06:15:51,322 26524 INFO odoo2 odoo.addons.base.models.ir_module: ALLOW access to module.update_list on [] to user __system__ #1 via n/a
2023-09-09 06:15:51,849 26524 INFO odoo2 odoo.modules.loading: loading 52 modules...
2023-09-09 06:15:51,878 26524 INFO odoo2 odoo.modules.loading: 52 modules loaded in 0.03s, 0 queries (+0 extra)
2023-09-09 06:15:52,030 26524 INFO odoo2 odoo.addons.base.models.ir_module: ALLOW access to module.module_uninstall on ['treegrid'] to user __system__ #1 via n/a
2023-09-09 06:15:52,036 26524 INFO odoo2 odoo.addons.base.models.ir_model: Deleting ir.model(732,)
2023-09-09 06:15:52,102 26524 INFO odoo2 odoo.models.unlink: User #1 deleted ir.model.data records with IDs: [51967]
2023-09-09 06:15:52,102 26524 INFO odoo2 odoo.models.unlink: User #1 deleted ir.model records with IDs: [732]
2023-09-09 06:15:52,103 26524 INFO odoo2 odoo.addons.base.models.ir_model: ir.model.data could not be deleted ([])
2023-09-09 06:15:52,106 26524 INFO odoo2 odoo.models.unlink: User #1 deleted ir.model.data records with IDs: [51967, 51966]
2023-09-09 06:15:52,109 26524 INFO odoo2 odoo.modules.loading: Reloading registry once more after uninstalling modules
2023-09-09 06:15:52,251 26524 INFO odoo2 odoo.modules.loading: loading 1 modules...
2023-09-09 06:15:52,258 26524 INFO odoo2 odoo.modules.loading: 1 modules loaded in 0.01s, 0 queries (+0 extra)
2023-09-09 06:15:52,278 26524 INFO odoo2 odoo.modules.loading: updating modules list
2023-09-09 06:15:52,283 26524 INFO odoo2 odoo.addons.base.models.ir_module: ALLOW access to module.update_list on [] to user __system__ #1 via n/a
2023-09-09 06:15:52,845 26524 INFO odoo2 odoo.modules.loading: loading 51 modules...
2023-09-09 06:15:52,877 26524 INFO odoo2 odoo.modules.loading: 51 modules loaded in 0.03s, 0 queries (+0 extra)
2023-09-09 06:15:53,393 26524 INFO odoo2 odoo.modules.loading: Modules loaded.
2023-09-09 06:15:53,399 26524 INFO odoo2 odoo.modules.registry: Registry loaded in 1.289s
2023-09-09 06:15:53,403 26524 INFO odoo2 odoo.modules.registry: Registry loaded in 2.123s
2023-09-09 06:15:53,405 26524 INFO odoo2 odoo.addons.base.models.ir_module: getting next ir.actions.todo()
{'type': 'ir.actions.act_url', 'target': 'self', 'url': '/web'}
>>> exit
大功告成。