everybody, please help in odoo, i know that the error message showing was use raise UserError(), but this function will break the function and rollback in database, what i want to do is just simplely show the successful message to user without break, like operation was successful!. of course, i have try to use the wizard, but the footer is not working, the page always show the save and discard appreciate if anybody can help me on this. thanks.
Asked
Active
Viewed 503 times
-1
-
If you need to hide Save and Discard buttons add an empty footer to the form. – Kenly Apr 07 '20 at 13:23
-
thanks,i have found the reason why the footer is not working, because of my fault,i had put the wizard xml file in Views folder, now i am knowing it's should be saved in the wizard folder.thanks anyway kenly! – Tony Tang Apr 09 '20 at 01:09
1 Answers
0
In that, you can use the onchange
API to work around this,
@api.onchange('my_field')
def my_field_change(self):
// warning message
return {
'warning': {'title': _('Error'), 'message': _('Error message'),},
}
With that, Perform the change with your case return
the warning message and it does not break the process.You can find a similar behavior on Odoo Sale App on sale order line product change operation.
Thanks

Dipen Shah
- 2,396
- 2
- 9
- 21
-
thanks Dipen, i have used the code "self.env.cr.commit()" before raise or return function, it's also working,thanks again. – Tony Tang Apr 09 '20 at 01:14