Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi, i have to select in idProd the products who respect those conditions :
idProd = product_product.search([('product_tmpl_id.ing', '=', True), ('product_tmpl_id.last_synchro_ing', '<', date)], order='id')
The problem is for the sample in bold because "product_tmpl_id.last_synchro_ing" is a string and "date" is a datetime.
So I don't know how to compare them in a search domain, thanks in advance.
There are also helper functions on the fields.Date model:
""" Convert an ORM ``value`` into a :class:`date` value. """
""" Convert a :class:`date` value into the format expected by the ORM. """
So you could do
idProd = product_product.search([('product_tmpl_id.ing', '=', True), ('product_tmpl_id.last_synchro_ing', '<', fields.Date.to_string(date))], order='id')
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/10/16, 6:17 AM|
|Seen: 1472 times|
|Last updated: 4/19/16, 4:24 PM|