payment_link_wizard.py 771 B

123456789101112131415161718192021222324252627
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. from odoo import models
  3. class PaymentLinkWizard(models.TransientModel):
  4. _inherit = 'payment.link.wizard'
  5. def _get_additional_link_values(self):
  6. """ Override of `payment` to add `invoice_id` to the payment link values.
  7. The other values related to the invoice are directly read from the invoice.
  8. Note: self.ensure_one()
  9. :return: The additional payment link values.
  10. :rtype: dict
  11. """
  12. res = super()._get_additional_link_values()
  13. if self.res_model != 'account.move':
  14. return res
  15. # Invoice-related fields are retrieved in the controller.
  16. return {
  17. 'invoice_id': self.res_id,
  18. }