I've already searching how to modify save button and get some solution like this :
def create(self, cr, uid, vals, context=None):
# Your logic goes here or call your method
res_id = super(reservation, self).create(cr, uid, vals, context=context)
# Your logic goes here or call your method
return res_id
def write(self, cr, uid, vals, context=None):
# Your logic goes here or call your method
super(reservation, self).write(cr, uid, id, vals, context=context)
# Your logic goes here or call your method
return True
I have Hotel module and class reservation. I want user will see this message warning
if self.duration < 0:
return {
'warning': {
'title': "Something bad happened",
'message': "It's very bad indeed",
}
}
if they break some condition like let the guest name and room number being not filled or let check out date less than check in date. Where should I locate this warning code in that function?
Odoo Customization Tips: https://old.reddit.com/r/learnopenerp/