i am trying to add search filter with name Today for CRM users to check today's Deadline Activities (date_deadline this field in model mail.activity)
i searched and found below solution but it is not working.
through "bug" icon on top, clicked on Manage Filters, then New to create one,
Name = Today, Model = Lead/Opportunity, Domain as below:
["&", ("date_deadline", ">=", datetime.datetime.combine(context_today(), datetime.time(0, 0, 0))),
("date_deadline", "<=", datetime.datetime.combine(context_today(), datetime.time(23, 59, 59)))]
but it is not working when user selects Today from search filter, please help.
regards
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
you can follow these steps:
- Go to the CRM module in the Odoo backend.
- Click on the "Activities" menu to access the activities view.
- Click on the "Filters" button at the top right corner of the view.
- Select "Manage Filters" from the dropdown menu.
- Click on the "Create" button to create a new filter.
- In the "Name" field, enter "Today" or any other desired name for the filter.
- In the "Model" field, select "Lead/Opportunity" or the appropriate model.
- In the "Domain" field, enter the following domain:
["&", ("activity_ids.date_deadline", ">=", datetime.datetime.combine(context_today(), datetime.time(0, 0, 0))),
("activity_ids.date_deadline", "<=", datetime.datetime.combine(context_today(), datetime.time(23, 59, 59)))]
- Click on the "Save" button to save the filter.
Now, when users select the "Today" filter from the search filter dropdown in the CRM activities view, it should show activities with a deadline for the current day.
Note: Make sure to import the necessary modules at the top of your Python file, such as datetime and fields.
thanks again @shubham shiroya,
the code below is working fine, posting here for my feedback and also for juniors like me if anyone has same problem to resolve.
in Developer mode, access CRM, click on Activity view and click on bug icon on top, then Manage Filters -> New. the Name = Today, Model = Lead/Opportunity and domain filter as below psted in code editor:
["&", ("activity_ids.date_deadline", ">=", datetime.datetime.combine(context_today(), datetime.time(0, 0, 0))),
("activity_ids.date_deadline", "<=", datetime.datetime.combine(context_today(), datetime.time(23, 59, 59)))]
regards
this added filter is showing in Favorite and contains delete icon which is inappropriate for production, please advise how to add it with other exising Filters without delete icon.
regards
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
2
มี.ค. 23
|
3070 | ||
|
3
ส.ค. 25
|
2226 | ||
|
1
พ.ค. 25
|
2506 | ||
|
1
เม.ย. 25
|
3496 | ||
|
1
เม.ย. 25
|
4323 |