Skip to Content
मेन्यू
This question has been flagged
2 Replies
2392 Views

Hello!!

Please, i have a field that i dont want to be an empty string.

I tried those choices:

1/ if ' ' in project:

My_error_Msg2 =  'Please your project can not be empty' raise osv.except_osv(_("Error!"), _(My_error_Msg2))

----> when the field contain two string separated by a space it raises an exception

2/ if  project == ' ':

My_error_Msg2 =  'Please your project can not be empty' raise osv.except_osv(_("Error!"), _(My_error_Msg2))

----> it doesnt raise an exception

Please help

Avatar
Discard
Best Answer

In case two you entered only a whitespace? or left the field empty?

The first case should also cover the case that there is only a single space in the string.

But I don't see why the second case is not working

Avatar
Discard
Related Posts Replies Views Activity
0
मार्च 25
1268
0
जन॰ 25
3327
1
अग॰ 23
14628
1
अग॰ 23
13273
1
जुल॰ 23
10287