Odoo Help

Welcome!

This community 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.

0

fetchall data in where clause openerp

By
lam a bao
on 2/9/14, 10:43 PM 956 views

Hi everyone : I have function :

   def _getvalue_byIdquotations(self,req,dbname,Id_child):
    resgister=RegistryManager.get(dbname)
    sql= """
        SELECT cvs_chil.codeproduct
        FROM cvs_quotations_cutproduct cvs_cut
        join cvs_quotations_product_child cvs_chil on cvs_cut.codeproduct_id=cvs_chil.codesystemdoor
        WHERE
          (cvs_cut.id_quotations = %d)
        """%(Id_child)

    with resgister.cursor() as cr:
        cr.execute(sql)
        restul=cr.fetchall()

        sql_exccute='''
        SELECT cvs_cut.codeproduct_id
        FROM product_category cate
        where (cate.id in %s)
        '''%(restul)
        cr.execute(sql_exccute)
        restul_excute=cr.fetchall()
    return restul_excute

But when i excute ,it error "ProgrammingError: syntax error at or near "[""

can you help me ?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/9/14, 10:43 PM
Seen: 956 times
Last updated: 3/16/15, 8:10 AM