Odoo 10 Query sql does not return value

0

I have a simple sql query but it does not return any value to me. Where can the error be? Thanks

@api.model_cr
def _compute_impuestos(self):
    """ Event Question main report """
    tools.drop_view_if_exists(self._cr, 'product.template')
    self._cr.execute(""" 
        SELECT
            id
        FROM
            product_template
        LIMIT 1
    """)
    res = self._cr.fetchone()
    return res
    
asked by portillo 23.07.2018 в 18:33
source

1 answer

0

In the fragment of code that shows there are several things that I do not understand so that you do them and it may be what causes your error.

tools.drop_view_if_exists(self._cr, 'product.template')

I think this is unnecessary because that view does not exist.

The decorator @ api.model_cr for you to use?

Did you debug the method?

Greetings

    
answered by 23.08.2018 в 19:43