请教,新API,onchange中判断输入有误,如何提示红色对话框?或弹出错误窗口?
-
尝试这样的代码无效,请教。
@api.onchange('available_num') # if these fields are changed, call method<br /> def check_change(self):<br /> if self.available_num > self.num:<br /> context={}<br /> context["key"]="value"<br /> ret = {<br /> 'type': 'ir.actions.client',<br /> 'tag': 'bs.error_message',<br /> 'context': context,<br /> }<br /> return ret
-
<br /> warning = {<br /> 'title': _('Warning!'),<br /> 'message': _('You must first select a partner!'),<br /> }<br /> return {'warning': warning}<br />
-
[quote author=mrshelly link=topic=17351.msg31220#msg31220 date=1445908853]
<br /> warning = {<br /> 'title': _('Warning!'),<br /> 'message': _('You must first select a partner!'),<br /> }<br /> return {'warning': warning}<br />
[/quote]
提示出字段无效的那种如何实现?