[app_sample] v18

This commit is contained in:
Chill
2024-11-18 15:29:13 +08:00
parent c5eb74ebc8
commit 66a1a7d2f3
52 changed files with 1446 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from odoo import http
from odoo.addons.portal.controllers.portal import CustomerPortal
class appCustomerPortal(CustomerPortal):
# Controler sample
@http.route('/my/webclient/locale/<string:lang>', type='http', auth="none")
def index(self, **kw):
return "Hello, world"
@http.route('/default/default/objects/', auth='public')
def list(self, **kw):
return http.request.render('default.listing', {
'root': '/default/default',
'objects': http.request.env['default.default'].search([]),
})
@http.route('/default/default/objects/<model("default.default"):obj>/', auth='public')
def object(self, obj, **kw):
return http.request.render('default.object', {
'object': obj
})