summaryrefslogtreecommitdiff
path: root/addons/pos_adyen
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2019-09-11 12:47:54 +0000
committerJoseph Caburnay <jcb@odoo.com>2019-09-12 05:34:09 +0000
commitc7ee7ce8e0a0d0de6f74a0ed10b8bd3d8b05e00a (patch)
treef11fea33924a9e067976c6aff574b0707c4df801 /addons/pos_adyen
parenta0c5a3cc4a7327801b370ec0ce3c3d36d441e521 (diff)
[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>
Diffstat (limited to 'addons/pos_adyen')
-rw-r--r--addons/pos_adyen/models/pos_payment_method.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/pos_adyen/models/pos_payment_method.py b/addons/pos_adyen/models/pos_payment_method.py
index 6576485cebd..4baa83afdd3 100644
--- a/addons/pos_adyen/models/pos_payment_method.py
+++ b/addons/pos_adyen/models/pos_payment_method.py
@@ -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)