Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3903 Widoki

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.

Awatar
Odrzuć

You can use "@api.constrains".

@api.constrains("your_field")

def alert(self):

if ??<??:

raise exceptions.ValidationError(u"Your Alert")

Najlepsza odpowiedź
from openerp.exceptions import ValidationError
 
#check your desired condition....
raise ValidationError("""your alert message goes here""")

Hope this will helps you

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
kwi 25
1524
1
sie 24
2392
3
maj 24
12005
1
wrz 23
3996
0
sie 23
1971