コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2534 ビュー

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"

アバター
破棄
最善の回答

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

アバター
破棄