Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
4008 Tampilan

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.

Avatar
Buang

You can use "@api.constrains".

@api.constrains("your_field")

def alert(self):

if ??<??:

raise exceptions.ValidationError(u"Your Alert")

Jawaban Terbai
from openerp.exceptions import ValidationError
 
#check your desired condition....
raise ValidationError("""your alert message goes here""")

Hope this will helps you

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Apr 25
1653
1
Agu 24
2592
3
Mei 24
12342
1
Sep 23
4199
0
Agu 23
2124