Hi, im using Odoo 14, i want to pop up a warning window when compute field calculating incorrect results.
i try to raise UserError, but this will hinder the display of the page.and returning the following code in compute callback function will not have any effect.
notification = {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': ('Warning'),
'message': ('Sensor value exceeds threshold'),
'sticky': True,
'type': 'danger'
},
}
how can i do in this function
is_check = fields.Integer(compute="_is_check")
def _is_check(self, *args):
for record in self:
record.is_check = 0
notification = {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': ('Warning'),
'message': ('Sensor value exceeds threshold'),
'sticky': True,
'type': 'danger'
},
}
return notification