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

How can i get a warning pop up before saving if a the state value == "done"?

Avatar
Discard

onchange api

Author Best Answer

Hello,

Thanks it works,

but can I get only the message when i click on save?

Avatar
Discard
Best Answer

Hi,

Please try the below code.

@api.onchange('state')
def onchange_state_warning(self):
if self.state == 'done':
warning_mess = {
'title': _('Your Warning Title!'),
'message': _(
'Your Custom Warning message.'),
}
return {'warning': warning_mess}
return {}

Regards

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
1485
1
Nov 24
1193
2
Sep 24
1047
1
Aug 24
2454
3
Aug 24
2687