Odoo Help


Controling \t in odoo v8

Vale Trood
on 7/13/15, 7:48 AM 782 views


I want to controle a field if it contains a space (\t) in odoo v8.

Pleas, how can i do it help

Elaborate your purpose little bit please !

Emipro Technologies Pvt. Ltd.
on 7/13/15, 8:38 AM

I have a field called project in which i wouldnt have empty string so i put it required= True and now i want it to NOT COTAIN a space.

Vale Trood
on 7/13/15, 8:44 AM
David Bertha
On 7/13/15, 8:57 AM

You should define a python constraint

_constraints = [(_function_name, warning_string, list_of_relevant_attributes)]
ex :

_constraints = [(_check_empty_string, 'The name cannot contains only spaces", ['name'])
def _check_empty_string(self, cr, uid, ids, context=None) : (old API way)
    project = self.browse(cr,uid, ids, context=context)
    return not project.name.isspace()

Atul Arvind

--Atul Arvind--
| 3 3 5
vadodara, India
--Atul Arvind--


I am odoo Enthusiast/Developer from Vadodara, India. Working with odoo from v5 to v11 and other opensource technology since 5+ years. Having Strong Expertise in

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


Here is my StackOverflow profile.  you can also find me on LinkedIn.

Contact: atul.surficle@gmail.com.

Atul Arvind
On 7/13/15, 9:29 AM

for v8 you can write constraint like to validate the space,

def check_name(self):
if self.name.isspace():
raise ValidationError("Name can not be Empty")

name = fields.Char('Name', required=True)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/13/15, 7:48 AM
Seen: 782 times
Last updated: 7/28/15, 9:45 AM