diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 8393170c2be..5a852ffa96f 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -428,7 +428,7 @@ class PaymentOption(models.Model): image_resize_images(vals) if 'image' in vals: - self.image_payment_form = image_resize_image(vals['image'], size=(45,30)) + vals['image_payment_form'] = image_resize_image(vals['image'], size=(45,30)) return super(PaymentOption, self).create(vals) @@ -436,7 +436,7 @@ class PaymentOption(models.Model): def write(self, vals): image_resize_images(vals) if 'image' in vals: - self.image_payment_form = image_resize_image(vals['image'], size=(45,30)) + vals['image_payment_form'] = image_resize_image(vals['image'], size=(45,30)) return super(PaymentOption, self).write(vals) class PaymentTransaction(models.Model): diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index 0942e46ac92..ba4f0d1a7c8 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -41,10 +41,10 @@ odoo.define('payment.payment_form', function (require){ inputs_form.toArray().forEach(function(element) { if(element.dataset.isRequired) { if (element.value.length === 0) { - $(element).closest('div').addClass('has-error'); + $(element).closest('div.form-group').addClass('has-error'); } else { - $(element).closest('div').removeClass('has-error'); + $(element).closest('div.form-group').removeClass('has-error'); } empty_inputs = true; } @@ -181,10 +181,10 @@ odoo.define('payment.payment_form', function (require){ inputs_form.toArray().forEach(function(element) { if(element.dataset.isRequired) { if (element.value.length === 0) { - $(element).closest('div').addClass('has-error'); + $(element).closest('div.form-group').addClass('has-error'); } else { - $(element).closest('div').removeClass('has-error'); + $(element).closest('div.form-group').removeClass('has-error'); } empty_inputs = true; }