Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3764 Prikazi

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
Opusti

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
apr. 25
1405
1
avg. 24
2213
3
maj 24
11606
1
sep. 23
3758
0
avg. 23
1822