[FIX] (account,website)_payment, sale: pass argument values in super call

before this commit, on inheriting the function
_get_custom_rendering_context_values the argument values are not received
in the inherited function as it is not passed along with the super

scenario:
* consider that the payment link is shared to customer
* customer made the full payment
* once the sale or invoice is fully paid, the link has to
be shown as fully paid or expired
* for doing this, if we inherit the above function, the
arguments is not passed to the function

after this commit, the argument values are passed to
super and the value can be used re used in the further
inherit of this function

closes odoo/odoo#134195

X-original-commit: 49b91e47c6c24e0023110365e7f9084a2c13ca5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
niyasraphy
2023-09-05 12:22:22 +00:00
committed by Antoine Vandevenne (anv)
parent f34540c535
commit 36cf1708a4
3 changed files with 15 additions and 4 deletions
@@ -88,7 +88,9 @@ class PaymentPortal(payment_portal.PaymentPortal):
:return: The extended rendering context values.
:rtype: dict
"""
rendering_context_values = super()._get_custom_rendering_context_values(**kwargs)
rendering_context_values = super()._get_custom_rendering_context_values(
invoice_id=invoice_id, **kwargs
)
if invoice_id:
rendering_context_values['invoice_id'] = invoice_id
+3 -1
View File
@@ -378,7 +378,9 @@ class PaymentPortal(payment_portal.PaymentPortal):
:return: The extended rendering context values
:rtype: dict
"""
rendering_context_values = super()._get_custom_rendering_context_values(**kwargs)
rendering_context_values = super()._get_custom_rendering_context_values(
sale_order_id=sale_order_id, **kwargs
)
if sale_order_id:
rendering_context_values['sale_order_id'] = sale_order_id
+9 -2
View File
@@ -84,8 +84,15 @@ class PaymentPortal(payment_portal.PaymentPortal):
return tx_sudo._get_processing_values()
def _get_custom_rendering_context_values(self, donation_options=None, donation_descriptions=None, is_donation=False, **kwargs):
rendering_context = super()._get_custom_rendering_context_values(**kwargs)
def _get_custom_rendering_context_values(
self, donation_options=None, donation_descriptions=None, is_donation=False, **kwargs
):
rendering_context = super()._get_custom_rendering_context_values(
donation_options=donation_options,
donation_descriptions=donation_descriptions,
is_donation=is_donation,
**kwargs,
)
if is_donation:
user_sudo = request.env.user
logged_in = not user_sudo._is_public()