Hello to all.
I hope someone has any hint about my problem.
I'm trying to filter records based on a double domain conditions.
My column is defined as follows:

'produto_id': fields.many2one('product.product', 'Item', 
domain=[('requisitar_ok','=',True),('id','in',[29,30,31,32,33,34,35,36,37])]),

However this way works but i would need to supply processed list of ids.

So i would like to have something like this working:

'produto_id': fields.many2one('product.product', 'Item', 
domain=[('requisitar_ok','=',True),('id','in',material_disp_get)]),

    def material_disp_get(self, cr, uid, ids, field_names, args, context):
        if not len(ids):
            return {}
        cr.execute("SELECT p.* FROM product_product p WHERE NOT EXISTS (SELECT 
* FROM material_ficha f, material_linha l WHERE f.id = l.ficha_id AND 
f.data_saida > '"+self.material.ficha.data_saida+"' AND f.data_entrada < 
'"+self.material.ficha.data_entrada+"' AND p.id = l.produto_id)")
        #cr.execute("SELECT p.* FROM product_product p")
        res = dict(cr.fetchall())
        return res

Hope someone would have any hints about how to do this.

Regards.

------------------------
GP




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=44230#44230

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to