Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3892 Zobrazení

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šit

You can use "@api.constrains".

@api.constrains("your_field")

def alert(self):

if ??<??:

raise exceptions.ValidationError(u"Your Alert")

Nejlepší odpověď
from openerp.exceptions import ValidationError
 
#check your desired condition....
raise ValidationError("""your alert message goes here""")

Hope this will helps you

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
dub 25
1522
1
srp 24
2388
3
kvě 24
11991
1
zář 23
3989
0
srp 23
1971