diff --git a/addons/google_recaptcha/i18n/google_recaptcha.pot b/addons/google_recaptcha/i18n/google_recaptcha.pot index 9086ee4aa77..4e9e5b05539 100644 --- a/addons/google_recaptcha/i18n/google_recaptcha.pot +++ b/addons/google_recaptcha/i18n/google_recaptcha.pot @@ -62,7 +62,7 @@ msgstr "" #. openerp-web #: code:addons/google_recaptcha/static/src/js/recaptcha.js:0 #, python-format -msgid "No recaptcha public key set." +msgid "No recaptcha site key set." msgstr "" #. module: google_recaptcha @@ -119,7 +119,7 @@ msgstr "" #. openerp-web #: code:addons/google_recaptcha/static/src/js/recaptcha.js:0 #, python-format -msgid "The recaptcha public key is invalid." +msgid "The recaptcha site key is invalid." msgstr "" #. module: google_recaptcha diff --git a/addons/google_recaptcha/static/src/js/recaptcha.js b/addons/google_recaptcha/static/src/js/recaptcha.js index 9bab4e7827a..b4ae76fd150 100644 --- a/addons/google_recaptcha/static/src/js/recaptcha.js +++ b/addons/google_recaptcha/static/src/js/recaptcha.js @@ -38,7 +38,7 @@ const ReCaptcha = Class.extend({ getToken: async function (action) { if (!this._publicKey) { return { - message: _t("No recaptcha public key set."), + message: _t("No recaptcha site key set."), }; } await this._recaptchaReady; @@ -48,7 +48,7 @@ const ReCaptcha = Class.extend({ }; } catch (e) { return { - error: _t("The recaptcha public key is invalid."), + error: _t("The recaptcha site key is invalid."), }; } }, diff --git a/addons/website_form/static/src/snippets/s_website_form/000.js b/addons/website_form/static/src/snippets/s_website_form/000.js index 3cb891a3069..ef45f11fc97 100644 --- a/addons/website_form/static/src/snippets/s_website_form/000.js +++ b/addons/website_form/static/src/snippets/s_website_form/000.js @@ -155,13 +155,16 @@ odoo.define('website_form.s_website_form', function (require) { form_values[$(this).find('input').attr('name')] = date.format(format); }); - const tokenObj = await this._recaptcha.getToken('website_form'); - if (tokenObj.token) { - form_values['recaptcha_token_response'] = tokenObj.token; - } else if (tokenObj.error) { - self.update_status('error', tokenObj.error); - return false; + if (!this.$target[0].classList.contains('s_website_form_no_recaptcha')) { + const tokenObj = await this._recaptcha.getToken('website_form'); + if (tokenObj.token) { + form_values['recaptcha_token_response'] = tokenObj.token; + } else if (tokenObj.error) { + self.update_status('error', tokenObj.error); + return false; + } } + // Post form and handle result ajax.post(this.$target.attr('action') + (this.$target.data('force_action') || this.$target.data('model_name')), form_values) .then(function (result_data) { diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 9870fd04417..68ccd5450e0 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -925,6 +925,7 @@
Previous Next +