跳至內容
選單
此問題已被標幟
2 回覆
3788 瀏覽次數

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
1429
1
8月 24
2261
3
5月 24
11697
1
9月 23
3794
0
8月 23
1835