تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1362 أدوات العرض

hello everyone, I'm posting this again and i closed previous post to provide more details about the problem in this post, any way.

i heave create custom route in customer portal, this route will navigate to new URL route and render to XML template, this route should search and return data from model(sale.order as example).

This is the route code:

class SaleOrders(http.Controller):
@http.route('/my/orders/', type='http', auth='user', website=False)
def display_customer_orders(self, **kwargs):
uid = request.env.user
user_employee_id = uid.employee_id.id
orders = request.env['sale.order'].sudo().search([])
if orders:
return request.render('sale_custom.portal_my_sale_orders', {'orders': orders})

and the XML template:



this is simple, but it shows me weird error never faced it before, it not even raised from my

custom add-ons , i have created custom routes before in other odoo versions but not in V16 EE.

 


الصورة الرمزية
إهمال
الكاتب أفضل إجابة

adding website = True solves the issue

But why ? anyone knows ?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 23
1732
3
نوفمبر 19
5408
1
مارس 24
1760
4
نوفمبر 23
2502
2
يوليو 23
5434