Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2529 Widoki

can anyone please tell mew how can i put a warning message in the odoo front end when soemone enter the wrong detail

am editing the leave form for my requrements, there is a type of leave that is allowed only for saudi citizens and not for other citizens, if the non saudi citizen enter the country, the warnign message should popup "This leave is allowed only for saudi citizens"

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You can do it using the constrains, see the example,

from odoo import models, fields, api, exceptions
@api.constrains('field_name')
def check_leave_type(self):
if give the condition:
raise exceptions.Warning('This leave is allowed only for saudi citizens')

See this: How To Add Constrains For A Field in Odoo

Thanks

Awatar
Odrzuć