From be0a325c5110770767c42ab9e77bb11a7e84693b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 26 Nov 2018 13:55:06 +0100 Subject: [PATCH] [FIX] account_banking_mandate: Condition is reversed So multi-company environment won't work correctly. --- account_banking_mandate/models/account_banking_mandate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/account_banking_mandate/models/account_banking_mandate.py b/account_banking_mandate/models/account_banking_mandate.py index e0d04ff33..d45a98633 100644 --- a/account_banking_mandate/models/account_banking_mandate.py +++ b/account_banking_mandate/models/account_banking_mandate.py @@ -100,7 +100,7 @@ class AccountBankingMandate(models.Model): if self.env['account.payment.line'].search( [('mandate_id', '=', mandate.id), - ('company_id', '=', mandate.company_id.id)], limit=1): + ('company_id', '!=', mandate.company_id.id)], limit=1): raise ValidationError( _("You cannot change the company of mandate %s, " "as there exists payment lines referencing it that " @@ -109,7 +109,7 @@ class AccountBankingMandate(models.Model): if self.env['account.invoice'].search( [('mandate_id', '=', mandate.id), - ('company_id', '=', mandate.company_id.id)], limit=1): + ('company_id', '!=', mandate.company_id.id)], limit=1): raise ValidationError( _("You cannot change the company of mandate %s, " "as there exists invoices referencing it that belong to " @@ -118,7 +118,7 @@ class AccountBankingMandate(models.Model): if self.env['account.move.line'].search( [('mandate_id', '=', mandate.id), - ('company_id', '=', mandate.company_id.id)], limit=1): + ('company_id', '!=', mandate.company_id.id)], limit=1): raise ValidationError( _("You cannot change the company of mandate %s, " "as there exists journal items referencing it that " @@ -127,7 +127,7 @@ class AccountBankingMandate(models.Model): if self.env['bank.payment.line'].search( [('mandate_id', '=', mandate.id), - ('company_id', '=', mandate.company_id.id)], limit=1): + ('company_id', '!=', mandate.company_id.id)], limit=1): raise ValidationError( _("You cannot change the company of mandate %s, " "as there exists bank payment lines referencing it that "