Files
odoo_source/addons/account_payment/models/payment.py
T
Johan Demaret Rivarola 54eddda79a [FIX] account_payment: post accounting-pocalypse aftermath
Some leftovers of
https://github.com/odoo/odoo/commit/beaa30a3d1843de43a45f419bfbc1bfa7613a920.

Fields have been renamed according to the following mapping:

residual_signed -> amount_residual_signed
reference       -> ref

State 'open' does not exist anymore, use 'posted' and combine it with
'invoice_payment_state' instead.
2019-07-11 09:32:41 +00:00

27 lines
811 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import fields, models, _
from odoo.tools import float_compare
_logger = logging.getLogger(__name__)
class PaymentTransaction(models.Model):
_inherit = 'payment.transaction'
def render_invoice_button(self, invoice, submit_txt=None, render_values=None):
values = {
'partner_id': invoice.partner_id.id,
}
if render_values:
values.update(render_values)
return self.acquirer_id.with_context(submit_class='btn btn-primary', submit_txt=submit_txt or _('Pay Now')).sudo().render(
self.reference,
invoice.amount_residual_signed,
invoice.currency_id.id,
values=values,
)