Skip to Content
Menú
This question has been flagged
2 Respostes
3707 Vistes

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
Descartar

You can use "@api.constrains".

@api.constrains("your_field")

def alert(self):

if ??<??:

raise exceptions.ValidationError(u"Your Alert")

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

Hope this will helps you

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
d’abr. 25
1357
1
d’ag. 24
2151
3
de maig 24
11415
1
de set. 23
3670
0
d’ag. 23
1757