diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 07f9b6f22..e0863a6e8 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -21,3 +21,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' + )]