Skip to content

Commit

Permalink
Merge pull request #1069 from ursais/cb-fix-osi-quote-downpayment
Browse files Browse the repository at this point in the history
[UPD] osi_quote_downpayment: add safety code to method
  • Loading branch information
cbeddies authored Jan 9, 2025
2 parents 66f64b3 + 919a02f commit c97af92
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions osi_quote_downpayment/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ def action_post(self):
downpayment_lines = {}
for rec in self:
downpayment_lines[rec.id] = {}
for line in rec.invoice_line_ids:
if "Down payment" in line.name:
downpayment_lines[rec.id][line.id] = line.price_unit
if rec.invoice_line_ids:
for line in rec.invoice_line_ids:
if "Down payment" in line.name:
downpayment_lines[rec.id][line.id] = line.price_unit
res = super().action_post()
for rec in self:
for line in rec.invoice_line_ids:
if "Down payment" in line.name:
downpayment_lines[rec.id][line.id] = line.price_unit
if rec.invoice_line_ids:
for line in rec.invoice_line_ids:
if "Down payment" in line.name:
downpayment_lines[rec.id][line.id] = line.price_unit
return res

0 comments on commit c97af92

Please sign in to comment.