From 03c673a73517aca5a3d0177bd9fa845e49a3e2cb Mon Sep 17 00:00:00 2001 From: dbh Date: Thu, 23 Mar 2017 15:57:06 +0530 Subject: [PATCH] [IMP] website_form_editor: improve thank you page field - Suggest website pages when setting the value - Label should not be bold --- static/src/js/website_form_editor.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/static/src/js/website_form_editor.js b/static/src/js/website_form_editor.js index 4d7870f6b73..80a9e8d67e0 100644 --- a/static/src/js/website_form_editor.js +++ b/static/src/js/website_form_editor.js @@ -139,6 +139,8 @@ odoo.define('website_form_editor', function (require) { } ); + self.$modal.find("label.control-label[for='success_page']").css('font-weight', 'normal'); + self.bind_data(); self.toggle_email_to(); self.$modal.find("[name='model_selection']").on('change', function() { @@ -245,6 +247,25 @@ odoo.define('website_form_editor', function (require) { // }); // }, + bind_data: function () { + // Display the list of website pages in thank you page input + var $thanksPageInput = this.$modal.find("input[name='success_page']"); + $thanksPageInput.autocomplete({ + source: function (request, response) { + return rpc.query({ + model: 'website', + method: 'search_pages', + args: [null, request.term, 15], + }).then(function (exists) { + var rs = _.map(exists, function (r) { + return r.loc; + }); + response(rs); + }); + } + }); + }, + toggle_email_to: function() { // Display or remove the magic email_to field for model mail.mail var selected_model_name = this.$modal.find("[name='model_selection']").val();