Odoo 如何在网站上只显示登录用户

Odoo 如何在网站上只显示登录用户,odoo,odoo-12,Odoo,Odoo 12,我使用奥多作为一个系统在我们公司,并希望使用内部新闻和信息的网站。然而,公众不应该看到该网站-只有登录的用户应该!未登录的观众应重定向到登录屏幕 这可能吗?我该怎么做?当您使用@http.route定义路由时,您有一个参数auth,您可以在其中定义它。从odoo文档中: auth – The type of authentication method, can on of the following: user: The user must be authenticated and

我使用奥多作为一个系统在我们公司,并希望使用内部新闻和信息的网站。然而,公众不应该看到该网站-只有登录的用户应该!未登录的观众应重定向到登录屏幕


这可能吗?我该怎么做?

当您使用@http.route定义路由时,您有一个参数auth,您可以在其中定义它。从odoo文档中:

auth –

The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.

当您使用@http.route定义路由时,请查看

,您有一个参数auth,您可以在其中定义它。从odoo文档中:

auth –

The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.
查看一下

这很简单,只需在controller的main.py文件中的方法中为auth=user

@http.route('/name', type='http', csrf=False, auth='user', website=True)
这很简单,只需在控制器的main.py文件中为方法中的auth=user

@http.route('/name', type='http', csrf=False, auth='user', website=True)

到目前为止你尝试了什么?到目前为止你尝试了什么?这似乎是一个很好的解决方案。我现在在哪里可以编辑这些Web控制器以添加所有路由所需的代码?你能给我一些更多的信息吗?这就像开发一个网站与奥多,你有一个简短的介绍:这似乎是一个伟大的解决方案。我现在在哪里可以编辑这些Web控制器以添加所有路由所需的代码?你能给我一些更多的信息吗?这就像用奥多开发一个网站,你有一个简短的介绍: