Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Done by RHT on the 03/01/2024
- # Task : https://www.odoo.com/odoo/project/17172/tasks/4269898
- # Pastebin : https://pastebin.com/Fy9sXta1
- # Need : Know how much is to be paid off in the loan
- for loan in self:
- invoices = loan.invoice_ids.filtered(lambda inv: inv.state == 'posted')
- paid = 0
- for invoice in invoices:
- paid += invoice.amount_total
- loan['x_studio_paid_amount'] = paid
- loan['x_studio_loan_remaining_balance'] = loan.x_studio_loan_total - loan.x_studio_loanpro_paid_amount - paid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement