diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/account_payment/models | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/account_payment/models')
| -rw-r--r-- | addons/account_payment/models/__init__.py | 4 | ||||
| -rw-r--r-- | addons/account_payment/models/payment.py | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/addons/account_payment/models/__init__.py b/addons/account_payment/models/__init__.py new file mode 100644 index 00000000..2ec5b9cd --- /dev/null +++ b/addons/account_payment/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import payment diff --git a/addons/account_payment/models/payment.py b/addons/account_payment/models/payment.py new file mode 100644 index 00000000..202afcaf --- /dev/null +++ b/addons/account_payment/models/payment.py @@ -0,0 +1,27 @@ +# -*- 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, + 'type': self.type, + } + 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, + invoice.currency_id.id, + values=values, + ) |
