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
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
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
2
feb. 19
|
5771 | |||
|
3
mar. 15
|
15142 | |||
|
0
okt. 19
|
3793 | |||
|
1
okt. 23
|
4916 | |||
|
1
sep. 20
|
4246 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.