[FIX] pos_adyen: active constraint if the identifier is empty
Disqualify the constraint in the adyen identifier if it is empty because it is not needed in other payment methods that are configured with other payment terminal. closes odoo/odoo#36702 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,8 @@ class PosPaymentMethod(models.Model):
|
||||
@api.constrains('adyen_terminal_identifier')
|
||||
def _check_adyen_terminal_identifier(self):
|
||||
for payment_method in self:
|
||||
if not payment_method.adyen_terminal_identifier:
|
||||
continue
|
||||
existing_payment_method = self.search([('id', '!=', payment_method.id),
|
||||
('adyen_terminal_identifier', '=', payment_method.adyen_terminal_identifier)],
|
||||
limit=1)
|
||||
|
||||
Reference in New Issue
Block a user