Advertisement
rht_odoo

x_studio_paid_amount

Jan 3rd, 2025 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. # Done by RHT on the 03/01/2024
  2. # Task : https://www.odoo.com/odoo/project/17172/tasks/4269898
  3. # Pastebin : https://pastebin.com/Knu5DsAv
  4. # Need : Know how much was already paid off in the loan (in previous program and in Odoo)
  5. for loan in self:
  6.     invoices = loan.invoice_ids.filtered(lambda inv: inv.state == 'posted')
  7.     paid = 0
  8.     for invoice in invoices:
  9.         paid += invoice.amount_total
  10.     loan['x_studio_paid_amount'] = paid + loan.x_studio_loanpro_paid_amount
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement