mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
[app_sample] v17
This commit is contained in:
3
app_sample/controllers/__init__.py
Normal file
3
app_sample/controllers/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# from . import main
|
||||
25
app_sample/controllers/main.py
Normal file
25
app_sample/controllers/main.py
Normal 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
|
||||
})
|
||||
Reference in New Issue
Block a user