Alert 动作要如何做呢 ?
- 
在.py 中. 我现在使用跳出讯息方式目前有2种, 都提示讯息..让使用者无法无法做下一步动作.. 
 1. raise osv.except_osv(('Warning!'),('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
 2. warning = {
 'title': "Warning for ",
 'message': "Notice : You cannot validate leaves for employee."
 }
 return {'warning': warning}
 目前我想 要的是跳出讯息. 但当做是通知而已...还可以做审批动作.
 很类似 view 的 confirm
 <button name="confirm" string="Confirm" states="accept" icon="gtk-jump-to" confirm="Are you sure Confirm?"/>
 会跳出 alert .
 如何在 py 中做到想要的动作呢 ?
- 
[quote author=digitalwow link=topic=4283.msg11675#msg11675 date=1343961234] 
 在.py 中. 我现在使用跳出讯息方式目前有2种, 都提示讯息..让使用者无法无法做下一步动作..
 1. raise osv.except_osv(('Warning!'),('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
 2. warning = {
 'title': "Warning for ",
 'message': "Notice : You cannot validate leaves for employee."
 }
 return {'warning': warning}
 目前我想 要的是跳出讯息. 但当做是通知而已...还可以做审批动作.
 很类似 view 的 confirm
 <button name="confirm" string="Confirm" states="accept" icon="gtk-jump-to" confirm="Are you sure Confirm?"/>
 会跳出 alert .
 如何在 py 中做到想要的动作呢 ?
 [/quote]
 第一种因为是抛出异常了,所以不能继续审批动作;
 第二种就是你所需要的,除了可以提供warning信息以外,实际上也可以同时返回值 return {'warning': warning, 'value': value}


