Skip to content

Commit

Permalink
Merge PR #293 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed Oct 18, 2023
2 parents 703df8e + 764a06b commit 31ab3e2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions account_invoice_report_payment_info/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
from odoo import models


class AccountInvoice(models.Model):
class AccountMove(models.Model):
_inherit = "account.move"

def _compute_payments_widget_reconciled_info(self):
res = super()._compute_payments_widget_reconciled_info()
if not res and not self.invoice_payments_widget:
return res
info_pattern = (
self.env["ir.config_parameter"]
.sudo()
.get_param("account_invoice_report_payment_info.info_pattern", default="")
)
Move = self.env["account.move"]
for payment_dict in self.invoice_payments_widget["content"]:
move = Move.browse(payment_dict["move_id"])
payment_dict["move_ref"] = move.ref
payment_dict["extra_info"] = info_pattern.format(**payment_dict)
for one in self:
if not res and not one.invoice_payments_widget:
continue
for payment_dict in one.invoice_payments_widget["content"]:
move = Move.browse(payment_dict["move_id"])
payment_dict["move_ref"] = move.ref
payment_dict["extra_info"] = info_pattern.format(**payment_dict)
return res

0 comments on commit 31ab3e2

Please sign in to comment.