Skip to Content
Menu
This question has been flagged
2 Replies
1763 Views

hello everyone

i have one date field when i select date days(sun,mon,...) will come automatic


now i inherit days field in hr.employe model 

i add how many days this employe is available


if i selected hr.employe in my module and select date if on this date employe not avilable so i want raise error how is thatb possible

Avatar
Discard
Author Best Answer

thank you but i know how to raise error my question is not that


Avatar
Discard

if want to know that where to raise error when user change date and employee field then you need to call 'onchange' of hr.employee field and date field. So, whenever anyone of this fields will change it called and you can check your condition. Based on your condition you can raise error.

Author

yes that is work thank you

Best Answer

Hello Ra_one_1_11,

In odoo there are different types of exception available to use. you can refer it from Odoo Official documention and use it according to your need. Check below links.

https://www.odoo.com/documentation/15.0/developer/reference/backend/orm.html#reference-exceptions

https://www.cybrosys.com/blog/raising-exceptions-in-the-odoo-15

Avatar
Discard