1

当我尝试继承外部 id web.assets_backend odoo 说外部 id 未找到这里是错误日志:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/tools/cache.py", line 85, in lookup
    r = d[key]
  File "/opt/odoo/sources/odoo/odoo/tools/func.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7fb3865beaf0>, 'web.assets_backend')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 680, in _tag_root
    f(rec)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 658, in _tag_template
    return self._tag_record(record)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 567, in _tag_record
    f_val = self.id_get(f_ref)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 663, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 669, in model_id_get
    return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_model.py", line 1935, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-35>", line 2, in _xmlid_lookup
  File "/opt/odoo/sources/odoo/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_model.py", line 1928, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: web.assets_backend

这个问题的解决方案是什么?提前致谢

4

1 回答 1

1

在odoo 15中,你不能继承web.assets_backend in view,也不能添加你的js或者css。你需要在manifest文件中添加。我分享示例代码。将此代码添加到清单文件。

'assets': {
        'web.assets_backend': [
            'pos_address/static/src/js/yourjs.js',
        ],
    },

于 2022-01-05T08:29:24.783 回答