跳至内容
菜单
此问题已终结
2 回复
3763 查看

Hi, 
Can anyone help me with this?
I need a popup/alert everytime the user(s) set the selling price less than the cost price, so that they would have to set the selling price equal to or greater than the cost price.

Thanks.

形象
丢弃

You can use "@api.constrains".

@api.constrains("your_field")

def alert(self):

if ??<??:

raise exceptions.ValidationError(u"Your Alert")

最佳答案
from openerp.exceptions import ValidationError
 
#check your desired condition....
raise ValidationError("""your alert message goes here""")

Hope this will helps you

形象
丢弃
相关帖文 回复 查看 活动
3
4月 25
1405
1
8月 24
2209
3
5月 24
11604
1
9月 23
3754
0
8月 23
1821