I want to add a filter condition of date range in my order page of portal website. How can I add it?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello Siddharth,
Thank you for your reply and guidance. I have two questions:
1. Can I extend the method portal_my_orders to update the list values instead of overriding this method? How to inherit the method?
2. This question is about the front end. How to add start and end dates to the front end? Are there any relevant case tips? For example,add two input box to collect the dates and a button to submit it to the controller, or add a modal dialog.
1. Consider below example for how to override method.
from odoo.addons.portal.controllers.portal import CustomerPortal
class CustomerPortal(CustomerPortal):
def portal_my_orders(self, page=1, date_begin=None, date_end=None, sortby=None, **kw):
res = super(CustomerPortal, self).portal_my_orders(page, date_begin, date_end, sortby, **kw)
# Update value of res here using res.qcontext.update().
return res
2. You can Inherit Template portal.portal_searchbar and add two input box with type="date". This will show input boxes near sortby option in my order portal.
Hello yourday,
You need to override portal_my_orders method of CustomerPortal class which you can find in sale -> controllers -> portal.py file and update list of values according to your condition.
Thanks, (Siddharth Tarpada)
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 7 25
|
1600 | ||
|
1
thg 5 24
|
2865 | ||
|
2
thg 2 24
|
2279 | ||
|
0
thg 4 23
|
1601 | ||
|
6
thg 2 23
|
18536 |