Odoo Help


How do I write ('product_tmpl_id.last_synchro_ing', '<', date) properly (as a search domain)

on 3/9/16, 8:23 AM 707 views

Hi, i wanna assign products in my db to idProduct with this line :

idProduct = product_product.search(['|', ('product_tmpl_id.ing', '=', True), ('product_tmpl_id.last_synchro_ing', '<', date)], order='id')

But the sample in bold doesn't work.

I tested with one product whom don't respect this condition ('product_tmpl_id.last_synchro_ing', '<', date) but the idProduct still includes it:

The product I tested :

date = 2016-03-02 13:10:53.017044

idProd[0].last_synchro_ing = 2016-03-09

An idea ? Thanks in advance.


Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/9/16, 2:33 PM


Idem, date should be a string...



And ps, you domain starts with one '|' (OR), so all product_tmpl_id.ing, == True will be returned !

Is it possible to compare two strings (the dates) with "('product_tmpl_id.last_synchro_ing', '

on 3/10/16, 5:44 AM

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

2 follower(s)


Asked: 3/9/16, 8:23 AM
Seen: 707 times
Last updated: 3/11/16, 4:08 AM