This question has been flagged
1 Reply
2515 Views

In Employee form Date of Birth field is current date is accepted i need below 18 years of Date of Birth i want to raise a Warning or Error Message how to solve this in OpenERP 7

Thanks Regards Sridharan G

Avatar
Discard
Best Answer

Create on_change method for date of birth field and use osv.except_osv to raise an error. See: http://help.openerp.com/question/16015/using-raise-osvexcept_osv/

Hope this helps,

Avatar
Discard
Author

How to validate this date.

Check that in the on_change method? You can compare datetime to datetime (http://docs.python.org/2/library/datetime.html)