Advertisement
rht_odoo

[3792792]x_studio_amount_to_invoice

Apr 3rd, 2024 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #Done by RHT on the 07/03/2024
  2. #Reviewed by EMI on the 03/04/2024
  3. #Review: https://pastebin.com/L0MM1xBs
  4. #911 task: https://www.odoo.com/web#id=3792792&cids=1&menu_id=4720&action=333&active_id=5686&model=project.task&view_type=form
  5. #Need: to know the amount to invoice (non-recurrent)
  6. for so in self:
  7.     invoiced_amount = 0
  8.     for invoice in so.invoice_ids:
  9.         invoiced_amount += invoice.amount_untaxed
  10.     diff =  so.non_recurring_total - invoiced_amount
  11.     if diff > 0:
  12.         so["x_studio_amount_to_invoice"] = diff
  13.     else:
  14.         so["x_studio_amount_to_invoice"] = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement