在odoo 8

时间:2016-04-20 14:14:59

标签: sql openerp

我的代码是这样的:

        try:
            res = 0.0
            for employee in self.browse(cr, uid, localdict['employee'].id, context=context):
                cr.execute('SELECT sum(total)as sum FROM hr_payslip_line ' \
                           'WHERE slip_id = (SELECT max(id) FROM hr_payslip WHERE employee_id = %s  ) ' \
                           'AND affect_on_social_assurance = True ', (employee.id,))

                res = cr.dictfetchone()

它无法获取任何数据,为什么会这样?当我在pgAdmin中运行查询时,它返回预期的结果。 但在此代码返回 res :(无,)当我调试它时, enter image description here

0 个答案:

没有答案