Skip to Content
Menú
This question has been flagged
2 Respostes
2371 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
0
de març 25
1264
0
de gen. 25
3306
1
d’ag. 23
14617
1
d’ag. 23
13257
1
de jul. 23
10278