python-3.x odoo 16添加自定义模块

6ie5vjzr  于 2023-03-24  发布在  Python
关注(0)|答案(1)|浏览(307)

我已经尝试将已经编写的模块添加到我的odoo 16,但我不知道为什么它给这个错误,我是新的odoo.我只是安装和配置在pycharm的odoo16,然后从github下载自定义模块,并将其复制在插件文件夹中的模块显示在应用程序中,但我不能激活它给我这个错误.

Traceback (most recent call last):
  File "D:\odoo\odoo-16.0\odoo\http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "D:\odoo\odoo-16.0\odoo\service\model.py", line 134, in retrying
    result = func()
  File "D:\odoo\odoo-16.0\odoo\http.py", line 1613, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "D:\odoo\odoo-16.0\odoo\http.py", line 1810, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "D:\odoo\odoo-16.0\odoo\addons\base\models\ir_http.py", line 149, in _dispatch
    result = endpoint(**request.params)
  File "D:\odoo\odoo-16.0\odoo\http.py", line 699, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "d:\odoo\odoo-16.0\addons\web\controllers\dataset.py", line 46, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "d:\odoo\odoo-16.0\addons\web\controllers\dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "D:\odoo\odoo-16.0\odoo\api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "D:\odoo\odoo-16.0\odoo\api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-74>", line 2, in button_immediate_install
  File "D:\odoo\odoo-16.0\odoo\addons\base\models\ir_module.py", line 76, in check_and_log
    return method(self, *args, **kwargs)
  File "D:\odoo\odoo-16.0\odoo\addons\base\models\ir_module.py", line 491, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "D:\odoo\odoo-16.0\odoo\addons\base\models\ir_module.py", line 615, in _button_immediate_function
    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "<decorator-gen-14>", line 2, in new
  File "D:\odoo\odoo-16.0\odoo\tools\func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "D:\odoo\odoo-16.0\odoo\modules\registry.py", line 90, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "D:\odoo\odoo-16.0\odoo\modules\loading.py", line 487, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "D:\odoo\odoo-16.0\odoo\modules\loading.py", line 371, in load_marked_modules
    loaded, processed = load_module_graph(
  File "D:\odoo\odoo-16.0\odoo\modules\loading.py", line 196, in load_module_graph
    model_names = registry.load(cr, package)
  File "D:\odoo\odoo-16.0\odoo\modules\registry.py", line 247, in load
    model = cls._build_model(self, cr)
  File "D:\odoo\odoo-16.0\odoo\models.py", line 615, in _build_model
    raise TypeError("Model %r does not exist in registry." % name)
TypeError: Model 'stock.production.lot' does not exist in registry.

对于额外的信息,我使用的是最新版本的pycharm+odoo16+ python3.10.9,这是我试图添加的模块https://github.com/odoo-ps/psae-btco/tree/sally-flower-shop/flower_shop

wz3gfoph

wz3gfoph1#

如果检查代码源,您会发现stock_production_lot.py文件已被删除并替换为stock_lot.py
更新代码并将stock.production.lot重命名为stock.lot

相关问题