我正在Odoo中开发一个自定义Qweb模块,当尝试使用PORTAL用户进行访问时遇到了一些问题。 对于管理员,该模块可以完美运行,但是当我尝试使用创建的门户网站的用户访问该模块时,该页面显示403 Forbidden。 我认为这是一个权利问题,但我无法解决。
这是输出错误。
2020-04-16 08:21:27,607 6273 WARNING prueba_1 odoo.addons.website.models.ir_http: 403 Forbidden:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/api.py", line 1049, in get
value = self._data[key][field][record._ids[0]]
KeyError: 14
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/fields.py", line 1005, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/core/odoo/api.py", line 1051, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.partner(14,).name', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/models.py", line 2851, in _prefetch_field
result = records.read([f.name for f in fs], load='_classic_write')
File "/opt/odoo/core/odoo/models.py", line 2806, in read
vals[name] = convert(record[name], record, use_name_get)
File "/opt/odoo/core/odoo/models.py", line 5134, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo/core/odoo/fields.py", line 1005, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/core/odoo/api.py", line 1053, in get
return value.get() if isinstance(value, SpecialValue) else value
File "/opt/odoo/core/odoo/api.py", line 1096, in getter
raise exception
odoo.exceptions.AccessError: ('No se ha podido completar la operación por restricciones de seguridad. Contacte por favor con su administrador de sistema.\n\n(Tipo de documento: Contact, Operación: read) - (Registros: [14, 7, 13], Usuario: 8)', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/addons/base/models/qweb.py", line 347, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_1393_677
File "<template>", line 2, in body_call_content_676
File "<template>", line 138, in foreach_675
File "/opt/odoo/core/odoo/fields.py", line 1009, in __get__
self.determine_value(record)
File "/opt/odoo/core/odoo/fields.py", line 1112, in determine_value
record._prefetch_field(self)
File "/opt/odoo/core/odoo/models.py", line 2854, in _prefetch_field
result = self.read([f.name for f in fs], load='_classic_write')
File "/opt/odoo/core/odoo/models.py", line 2806, in read
vals[name] = convert(record[name], record, use_name_get)
File "/opt/odoo/core/odoo/models.py", line 5134, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo/core/odoo/fields.py", line 1005, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/core/odoo/api.py", line 1053, in get
return value.get() if isinstance(value, SpecialValue) else value
File "/opt/odoo/core/odoo/api.py", line 1096, in getter
raise exception
odoo.exceptions.AccessError: ('No se ha podido completar la operación por restricciones de seguridad. Contacte por favor con su administrador de sistema.\n\n(Tipo de documento: Contact, Operación: read) - (Registros: [14], Usuario: 8)', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/addons/base/models/ir_http.py", line 203, in _dispatch
result = request.dispatch()
File "/opt/odoo/core/odoo/http.py", line 835, in dispatch
r = self._call_function(**self.params)
File "/opt/odoo/core/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/core/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/core/odoo/http.py", line 342, in checked_call
result.flatten()
File "/opt/odoo/core/odoo/http.py", line 1270, in flatten
self.response.append(self.render())
File "/opt/odoo/core/odoo/http.py", line 1263, in render
return env["ir.ui.view"].render_template(self.template, self.qcontext)
File "/opt/odoo/core/odoo/addons/base/models/ir_ui_view.py", line 1310, in render_template
return self.browse(self.get_view_id(template)).render(values, engine)
File "/opt/odoo/core/addons/website/models/ir_ui_view.py", line 324, in render
return super(View, self).render(values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/opt/odoo/core/addons/web_editor/models/ir_ui_view.py", line 27, in render
return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/opt/odoo/core/odoo/addons/base/models/ir_ui_view.py", line 1319, in render
return self.env[engine].render(self.id, qcontext)
File "/opt/odoo/core/odoo/addons/base/models/ir_qweb.py", line 59, in render
result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
File "/opt/odoo/core/odoo/addons/base/models/qweb.py", line 275, in render
self.compile(template, options)(self, body.append, values or {})
File "/opt/odoo/core/odoo/addons/base/models/qweb.py", line 354, in _compiled_fn
raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
odoo.addons.base.models.qweb.QWebException: ('No se ha podido completar la operación por restricciones de seguridad. Contacte por favor con su administrador de sistema.\n\n(Tipo de documento: Contact, Operación: read) - (Registros: [14], Usuario: 8)', None)
Traceback (most recent call last):
File "/opt/odoo/core/odoo/api.py", line 1049, in get
value = self._data[key][field][record._ids[0]]
KeyError: 14
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/fields.py", line 1005, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/core/odoo/api.py", line 1051, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.partner(14,).name', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/core/odoo/models.py", line 2851, in _prefetch_field
result = records.read([f.name for f in fs], load='_classic_write')
File "/opt/odoo/core/odoo/models.py", line 2806, in read
vals[name] = convert(record[name], record, use_name_get)
File "/opt/odoo/core/odoo/models.py", line 5134, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo/core/odoo/fields.py", line 1005, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/core/odoo/api.py", line 1053, in get
return value.get() if isinstance(value, SpecialValue) else value
File "/opt/odoo/core/odoo/api.py", line 1096, in getter
raise exception
odoo.exceptions.AccessError: ('No se ha podido completar la operación por restricciones de seguridad. Contacte por favor con su administrador de sistema.\n\n(Tipo de documento: Contact, Operación: read) - (Registros: [14, 7, 13], Usuario: 8)', None)
Error to render compiling AST
AccessError: ('No se ha podido completar la operación por restricciones de seguridad. Contacte por favor con su administrador de sistema.\n\n(Tipo de documento: Contact, Operación: read) - (Registros: [14], Usuario: 8)', None)
Template: 1393
Path: /templates/t/t/xpath/div[2]/div[2]/div[2]/div[2]/div/div[4]/ul/t/li/t/p[4]/t
Node: <t t-esc="timetable.student_id.name"/>
感谢阅读!