[FIX] payment_authorize: fix multiple forms bug

Due to default JS limitations, when trying to save payment method on
subscription it was automatically taking first form that it could
find which was payment form and causing an error since payment form
was empty.

task-3339230

closes odoo/odoo#127332

X-original-commit: 252320a6154ba06cc4c7f96787a39baf12329804
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Anita (anko)
2023-07-05 14:34:00 +02:00
parent 46b18d391f
commit 22179ca948
@@ -21,19 +21,19 @@
_getInlineFormInputs: function (providerId) {
if (this.authorizeInfo.payment_method_type === "credit_card") {
return {
card: document.getElementById(`o_authorize_card_${providerId}`),
month: document.getElementById(`o_authorize_month_${providerId}`),
year: document.getElementById(`o_authorize_year_${providerId}`),
code: document.getElementById(`o_authorize_code_${providerId}`),
card: this.el.querySelector(`#o_authorize_card_${providerId}`),
month: this.el.querySelector(`#o_authorize_month_${providerId}`),
year: this.el.querySelector(`#o_authorize_year_${providerId}`),
code: this.el.querySelector(`#o_authorize_code_${providerId}`),
};
} else {
return {
accountName: document.getElementById(`o_authorize_account_name_${providerId}`),
accountNumber: document.getElementById(
`o_authorize_account_number_${providerId}`
accountName: this.el.querySelector(`#o_authorize_account_name_${providerId}`),
accountNumber: this.el.querySelector(
`#o_authorize_account_number_${providerId}`
),
abaNumber: document.getElementById(`o_authorize_aba_number_${providerId}`),
accountType: document.getElementById(`o_authorize_account_type_${providerId}`),
abaNumber: this.el.querySelector(`#o_authorize_aba_number_${providerId}`),
accountType: this.el.querySelector(`#o_authorize_account_type_${providerId}`),
};
}
},