Skip to Content
Menu
This question has been flagged
2 Replies
3693 Views

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
Discard

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
Discard
Related Posts Replies Views Activity
3
Apr 25
1344
1
Aug 24
2132
3
May 24
11340
1
Sep 23
3658
0
Aug 23
1749