Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1761 Переглядів

i have written below compute method code using Technical -> Models of a field, i want to get Value only in field x_loan_applicable_amount but its throwing error, below query contains inner or sub-query (i tested on pgAdmin but don't know how to pass parameter here due to additional sub-query):

for rec in self:
    applicable_amount = 0
    self.env.cr.execute("select sum(amount) applicable_amount from hr_payslip_input where payslip_id in (select id from hr_payslip where employee_id=%s", (rec.id)))
    self.env.cr.execute(query)
    applicable_data = self.env.cr.fetchall()
    # rec.x_loan_applicable_amount = applicable_data.applicable_amount


i already have tried to place ')' in differently but failed, always throwing error.

note: one important thing too is how to print value in odoo.log file from here? on using print() method it is showing error that print is not defiend.

please help.

regards


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
квіт. 25
2582
1
бер. 25
2326
4
серп. 24
3768
3
лют. 24
3998
1
січ. 24
3465