[FIX] account_peppol: fix saving of the verification code

When the verification code is saved,
it triggers the full save and and users get errors about other required fields, e.g. website language missing.
This commit removes save on every focusout, as the save is triggered when clicking confirm.

closes odoo/odoo#147037

X-original-commit: 06d67a05211a24b856b95bc3bdae775dfbd90c19
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
This commit is contained in:
aliya
2023-12-21 13:01:14 +00:00
parent 88213dfbbd
commit 19852c3bb4
@@ -61,8 +61,9 @@ class VerificationCodeWidget extends Component {
_save() {
let verificationCode = [...this.inputs.map((i) => i.el.value)].join('');
this.props.record.update({ account_peppol_verification_code: verificationCode });
this.env.model.root.save({ reload: false });
if (verificationCode.length === 6) {
this.props.record.update({ account_peppol_verification_code: verificationCode });
}
}
}