Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ addon | version | maintainers | summary
[website_cookiebot](website_cookiebot/) | 18.0.1.0.0 | | Ask for cookies consent connecting with Cookiebot
[website_cookiefirst](website_cookiefirst/) | 18.0.2.0.0 | | Cookiefirst integration
[website_crm_quick_answer](website_crm_quick_answer/) | 18.0.1.0.0 | | Add an automatic answer for contacts asking for info
[website_form_require_legal](website_form_require_legal/) | 18.0.1.0.1 | | Add possibility to require confirm legal terms.
[website_form_require_legal](website_form_require_legal/) | 18.0.1.0.2 | | Add possibility to require confirm legal terms.
[website_forum_subscription](website_forum_subscription/) | 18.0.1.0.2 | | Adds a button to allow subscription from the website
[website_google_tag_manager](website_google_tag_manager/) | 18.0.1.0.0 | | Add support for Google Tag Manager
[website_legal_page](website_legal_page/) | 18.0.1.0.0 | | Website Legal Page
Expand Down
2 changes: 1 addition & 1 deletion website_form_require_legal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Website Form Require Legal
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ab5a7e82627cb3a67056e5a87d41c410f6c0a84eacb0364b06c089b39c9fca68
!! source digest: sha256:c5c6d50060da43b51d9d0fc4c9bfad538e667e0c5383d6becc368d302954e4e3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion website_form_require_legal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Website Form Require Legal",
"summary": "Add possibility to require confirm legal terms.",
"version": "18.0.1.0.1",
"version": "18.0.1.0.2",
"category": "Website",
"license": "LGPL-3",
"website": "https://github.com/OCA/website",
Expand Down
2 changes: 1 addition & 1 deletion website_form_require_legal/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Website Form Require Legal</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ab5a7e82627cb3a67056e5a87d41c410f6c0a84eacb0364b06c089b39c9fca68
!! source digest: sha256:c5c6d50060da43b51d9d0fc4c9bfad538e667e0c5383d6becc368d302954e4e3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/website/tree/18.0/website_form_require_legal"><img alt="OCA/website" src="https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_form_require_legal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/website&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the possibility to require confirm legal terms at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
import {Component} from "@odoo/owl";
import publicWidget from "@web/legacy/js/public/public_widget";

publicWidget.registry.TermsAndConditionsCheckbox = publicWidget.Widget.extend({
selector: 'div[name="website_form_terms_and_conditions"]',
events: {
"change #website_form_terms_and_conditions_input": "_onClickCheckbox",
},
publicWidget.registry.WebsiteFormTermsAndConditionsCheckbox =
publicWidget.Widget.extend({
selector: 'div[name="website_form_terms_and_conditions"]',
events: {
"change #website_form_terms_and_conditions_input": "_onClickCheckbox",
},

async start() {
this.checkbox = this.el.querySelector(
"#website_form_terms_and_conditions_input"
);
Component.env.bus.trigger("enableSubmitButton");
return this._super(...arguments);
},
_onClickCheckbox() {
if (this.checkbox.checked) {
async start() {
this.checkbox = this.el.querySelector(
"#website_form_terms_and_conditions_input"
);
Component.env.bus.trigger("enableSubmitButton");
} else {
Component.env.bus.trigger("disableSubmitButton");
}
},
});
return this._super(...arguments);
},
_onClickCheckbox() {
if (this.checkbox.checked) {
Component.env.bus.trigger("enableSubmitButton");
} else {
Component.env.bus.trigger("disableSubmitButton");
}
},
});

export default publicWidget.registry.TermsAndConditionsCheckbox;