[FIX] sale_payment_deposit: fix error in portal payment process

This commit is contained in:
Cedric Collins
2021-10-28 15:56:19 -05:00
parent 7fec733c5c
commit 4e30a53469

View File

@@ -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,
)