本文整理匯總了Python中odoo.http.request.render方法的典型用法代碼示例。如果您正苦於以下問題:Python request.render方法的具體用法?Python request.render怎麽用?Python request.render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類odoo.http.request
的用法示例。
在下文中一共展示了request.render方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: hello
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def hello(self,**kwargs):
return request.render('bug-website.hello')
示例2: index
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def index(self, **kwargs):
Bugs = request.env['bm.bug']
bugs = Bugs.search([])
return request.render(
'bug-website.index',
{'bugs': bugs})
示例3: detail
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def detail(self, bug, **kwargs):
return http.request.render(
'bug-website.detail',
{'bug': bug})
示例4: add
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def add(self, **kwargs):
users = request.env['res.users'].search([])
return request.render(
'bug-website.add', {'users': users})
示例5: library_books
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def library_books(self):
country_id = False
country_code = request.session.geoip and request.session.geoip.get('country_code') or False
if country_code:
country_ids = request.env['res.country'].sudo().search([('code', '=', country_code)])
if country_ids:
country_id = country_ids[0].id
domain = ['|', ('restrict_country_ids', '=', False), ('restrict_country_ids', 'not in', [country_id])]
return request.render(
'my_library.books', {
'books': request.env['library.book'].search(domain),
})
示例6: library_book_detail
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def library_book_detail(self, book):
return request.render(
'my_library.book_detail', {
'book': book,
'main_object': book
})
示例7: books_issues
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def books_issues(self, **post):
if post.get('book_id'):
book_id = int(post.get('book_id'))
issue_description = post.get('issue_description')
request.env['book.issue'].sudo().create({
'book_id': book_id,
'issue_description': issue_description,
'submitted_by': request.env.user.id
})
return request.redirect('/books/submit_issues?submitted=1')
return request.render('my_library.books_issue_form', {
'books': request.env['library.book'].search([]),
'submitted': post.get('submitted', False)
})
示例8: library_books
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def library_books(self):
return request.render(
'my_library.books', {
'books': request.env['library.book'].search([]),
})
示例9: library_book_detail
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def library_book_detail(self, book):
return request.render(
'my_library.book_detail', {
'book': book,
})
示例10: helloworld
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def helloworld(self):
# return('<h1>Hello World!</h1>')
return request.render('library_website.helloworld')
示例11: hellocms
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def hellocms(self, page, **kwargs):
return http.request.render(page)
示例12: checkouts
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def checkouts(self, **kwargs):
Checkout = request.env['library.checkout']
checkouts = Checkout.search([])
return request.render(
'library_website.index',
{'docs': checkouts})
示例13: checkout
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def checkout(self, doc, **kwargs):
return http.request.render(
'library_website.checkout',
{'doc': doc})
示例14: checkout_create
# 需要導入模塊: from odoo.http import request [as 別名]
# 或者: from odoo.http.request import render [as 別名]
def checkout_create(self, **kwargs):
books = request.env['library.book'].search([])
member = request.env['library.member'].search(
[('partner_id', '=', request.env.user.partner_id.id)],
limit=1)
return request.render(
'library_website.checkout_create',
{'books': books, 'member': member})