Hey community,
I am able to render template in odoo v15 but unable to achieve it in odoo v11 is there any method name change
my v15 code:
@http.route(['/onclick/button'], type='json', auth='public', website=True)
def on_click_button(self, **kwargs):
value = {}
products = request.env['product.template'].search([])
value['product_list'] = request.env["ir.ui.view"]._render_template(
"js_example.p_name_template", {'products': products, 'flag': 'products'})
return value
My v11 code:
@http.route(['/onclick/button'], type='json', auth='public', website=True)
def on_click_button(self, **kwargs):
value = {}
products = request.env['product.template'].search([])
value['product_list'] = request.env["ir.ui.view"]._render_template(
"js_example.p_name_template", {'products': products, 'flag': 'products'})
return value