diff --git a/sale_payment_deposit/models/payment.py b/sale_payment_deposit/models/payment.py index f19bf7f1..e20e36cc 100644 --- a/sale_payment_deposit/models/payment.py +++ b/sale_payment_deposit/models/payment.py @@ -31,3 +31,19 @@ class PaymentTransaction(models.Model): self.amount, ) ) + + def render_sale_button(self, order, submit_txt=None, render_values=None): + values = { + 'partner_id': order.partner_id.id, + 'type': self.type, + } + if render_values: + values.update(render_values) + # Not very elegant to do that here but no choice regarding the design. + self._log_payment_transaction_sent() + return self.acquirer_id.with_context(submit_class='btn btn-primary', submit_txt=submit_txt or _('Pay Now')).sudo().render( + self.reference, + order.amount_total_deposit or order.amount_total, + order.pricelist_id.currency_id.id, + values=values, + )