From 84ac5fc35bd4311cb02065cfa12d5c2f5967fa9a Mon Sep 17 00:00:00 2001 From: augusto-weiss Date: Wed, 26 Jun 2024 16:36:54 -0300 Subject: [PATCH] [FIX] payment_multic_ux: search existing account_payment_method_line --- payment_multic_ux/models/payment_provider.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/payment_multic_ux/models/payment_provider.py b/payment_multic_ux/models/payment_provider.py index c581cc74..fc8efa16 100644 --- a/payment_multic_ux/models/payment_provider.py +++ b/payment_multic_ux/models/payment_provider.py @@ -27,7 +27,10 @@ def _link_payment_method_to_journal(self, provider): code = provider._get_code() default_payment_method_id = provider._get_default_payment_method_id(provider._get_code()) # cambio el dominio de búsqueda sino no me detecta el existing_payment_method_line y me lo duplica - existing_payment_method_line = self.env['account.payment.method.line'].search([('journal_id.company_id', '=', provider.company_id.id),('code', '=', provider.code),('payment_method_id', '=', default_payment_method_id),('code', '=', code),], limit=1) + existing_payment_method_line = self.env['account.payment.method.line'].search([ + ('journal_id.company_id', '=', provider.journal_id.company_id.id), + ('payment_method_id', '=', default_payment_method_id), + ('code', '=', code),], limit=1) if not existing_payment_method_line: self.env['account.payment.method.line'].create({ 'payment_method_id': default_payment_method_id,