diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 9d9499036..6f4ca7ee7 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -22,3 +22,11 @@ class AccountPaymentMethod(models.Model): self.ensure_one() raise UserError(_( "No XSD file path found for payment method '%s'") % self.name) + + _sql_constraints = [( + # Extending this constraint from account_payment_mode + 'code_payment_type_unique', + 'unique(code, payment_type, pain_version)', + 'A payment method of the same type already exists with this code' + ' and PAIN version' + )]