Skip to Content
Menu
This question has been flagged
2 Replies
3773 Zobrazenia

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
Zrušiť

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
3
apr 25
1416
1
aug 24
2250
3
máj 24
11666
1
sep 23
3775
0
aug 23
1830