[IMP] website_form_editor: improve thank you page field

- Suggest website pages when setting the value
- Label should not be bold
This commit is contained in:
dbh
2017-06-28 14:52:07 +02:00
committed by qsm-odoo
parent abb92cb854
commit 03c673a735
+21
View File
@@ -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();