[FIX] account_payment: handle error while computing suitable payment token

This traceback may arise while computing suitable payment tokens,
when a user clicks register payment in invoice.

Because in '_compute_suitable_payment_token_ids' method,
instead of 'paymet.token' 'payment.tokeb' is used.
Which is an invalid model name. It leads to keyerror

Error: 'KeyError: 'payment.tokeb''

See:
https://github.com/odoo/odoo/blob/60598dff9d8482bcea2f32fea6df1b1b71c760d6/addons/account_payment/wizards/account_payment_register.py#L36-L41

sentry-4380761438

closes odoo/odoo#132725

X-original-commit: f169d92454bba61547dc5bbbc3a6f9c45798562e
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
This commit is contained in:
althaf shaik
2023-08-22 20:01:08 +02:00
parent 13656c71c3
commit 07dea7ba45
@@ -37,7 +37,7 @@ class AccountPaymentRegister(models.TransientModel):
for wizard in self:
if wizard.can_edit_wizard and wizard.use_electronic_payment_method:
wizard.suitable_payment_token_ids = self.env['payment.token'].sudo().search([
*self.env['payment.tokeb']._check_company_domain(wizard.company_id),
*self.env['payment.token']._check_company_domain(wizard.company_id),
('provider_id.capture_manually', '=', False),
('partner_id', '=', wizard.partner_id.id),
('provider_id', '=', wizard.payment_method_line_id.payment_provider_id.id),