Hello
I need warning when assigning user for multiple tasks at the same start and end date
So, I need function search for user ID and dates and rais warning
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello
I need warning when assigning user for multiple tasks at the same start and end date
So, I need function search for user ID and dates and rais warning
Hi,
Either you can use the constrains or override the create/write method to show the warning message. First method will be better.
You can add below code in your function,
existing_task = self.env['project.task'].search([('user_id', '=', self.user_id.id), ('date_field', '=', date_value)])
if existing_task:
raise ValidationError(_('Message..!'))
This is just a rough code which is not tested, you can set the search condition accordingly and raise the warning.
Also Check this : Constrains in Odoo
Thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Feb 19
|
3194 | ||
|
3
Mar 15
|
12371 | ||
|
0
Oct 19
|
1865 | ||
|
1
Oct 23
|
1158 | ||
|
1
Sep 20
|
1905 |