mirror of
https://github.com/bringout/oca-ocb-test.git
synced 2026-04-23 22:22:01 +02:00
19.0 vanilla
This commit is contained in:
parent
38c6088dcc
commit
d9452d2060
243 changed files with 30797 additions and 10815 deletions
|
|
@ -1 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import portal
|
||||
|
|
|
|||
|
|
@ -9,6 +9,34 @@ class PortalTest(http.Controller):
|
|||
def test_portal_record_view(self, res_id, access_token=None, **kwargs):
|
||||
return request.make_response(f'Record view of test_portal {res_id} ({access_token}, {kwargs})')
|
||||
|
||||
@http.route("/my/test_portal_records/<int:res_id>", type="http", auth="public", website=True)
|
||||
def test_portal_record_page(self, res_id, **kwargs):
|
||||
record = request.env["mail.test.portal"]._get_thread_with_access(res_id, **kwargs)
|
||||
values = {
|
||||
"object": record,
|
||||
"token": kwargs.get("token"),
|
||||
"hash": kwargs.get("hash", None),
|
||||
"pid": kwargs.get("pid", None),
|
||||
}
|
||||
return request.render("test_mail_full.test_portal_template", values)
|
||||
|
||||
@http.route("/my/test_portal_rating_records/<int:res_id>", type="http", auth="public", website=True)
|
||||
def test_portal_rating_record_page(self, res_id, **kwargs):
|
||||
access_params = {
|
||||
"hash": kwargs.get("hash"),
|
||||
"pid": kwargs.get("pid"),
|
||||
"token": kwargs.get("token"),
|
||||
}
|
||||
record = request.env["mail.test.rating"]._get_thread_with_access(res_id, **access_params)
|
||||
return request.render(
|
||||
"test_mail_full.test_portal_template",
|
||||
{
|
||||
**access_params,
|
||||
"object": record,
|
||||
"display_rating": kwargs.get("display_rating"),
|
||||
},
|
||||
)
|
||||
|
||||
@http.route('/test_portal/public_type/<int:res_id>', type='http', auth='public', methods=['GET'])
|
||||
def test_public_record_view(self, res_id):
|
||||
return request.make_response(f'Testing public controller for {res_id}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue