[ADD] Allow for multiple SEPA payment methods with different versions (#493)

This commit is contained in:
Stefan Rijnhart (Opener)
2018-07-25 14:47:36 +02:00
committed by Alexis de Lattre
parent a0418bda45
commit 144dea8c86

View File

@@ -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'
)]