Search code examples
pythonpython-2.7odoo-8odoo

What is the syntax error in this line of code in Odoo


I am kind of newbie to python and odoo and am getting invalid syntax error in the following line of code

template_id = self.pool.get('email.template').search(cr, uid, [('name','=ilike',Meeting Invitation)])

Can anyone please kindly help me?


Solution

  • You must use quotes around Meeting Invitation and you should pass the context as a parameter to the search method:

    template_id = self.pool.get('email.template').search(cr, uid, [('name', '=ilike', 'Meeting Invitation')], context)