[IMP] (account_)payment, sale: add docstrings
Add docstrings to clarify methods in the payment link wizard. closes odoo/odoo#100186 Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
@@ -7,6 +7,15 @@ class PaymentLinkWizard(models.TransientModel):
|
||||
_inherit = 'payment.link.wizard'
|
||||
|
||||
def _get_additional_link_values(self):
|
||||
""" Override of `payment` to add `invoice_id` to the payment link values.
|
||||
|
||||
The other values related to the invoice are directly read from the invoice.
|
||||
|
||||
Note: self.ensure_one()
|
||||
|
||||
:return: The additional payment link values.
|
||||
:rtype: dict
|
||||
"""
|
||||
res = super()._get_additional_link_values()
|
||||
if self.res_model != 'account.move':
|
||||
return res
|
||||
|
||||
@@ -145,6 +145,13 @@ class PaymentLinkWizard(models.TransientModel):
|
||||
payment_link.link = f'{base_url}/payment/pay?{urls.url_encode(url_params)}'
|
||||
|
||||
def _get_additional_link_values(self):
|
||||
""" Return the additional values to append to the payment link.
|
||||
|
||||
Note: self.ensure_one()
|
||||
|
||||
:return: The additional payment link values.
|
||||
:rtype: dict
|
||||
"""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'currency_id': self.currency_id.id,
|
||||
|
||||
@@ -23,6 +23,15 @@ class PaymentLinkWizard(models.TransientModel):
|
||||
return super()._get_payment_provider_available(**kwargs)
|
||||
|
||||
def _get_additional_link_values(self):
|
||||
""" Override of `payment` to add `sale_order_id` to the payment link values.
|
||||
|
||||
The other values related to the sales order are directly read from the sales order.
|
||||
|
||||
Note: self.ensure_one()
|
||||
|
||||
:return: The additional payment link values.
|
||||
:rtype: dict
|
||||
"""
|
||||
res = super()._get_additional_link_values()
|
||||
if self.res_model != 'sale.order':
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user