ITISAG-Git
5 years ago
11 changed files with 76 additions and 57 deletions
-
2.gitignore
-
0website_contact_extend/__manifest__.py
-
45website_contact_extend/controllers/contactby.py
-
41website_contact_extend/controllers/myfilter.py
-
0website_contact_extend/models/__init__.py
-
2website_contact_extend/models/res_partner.py
-
23website_contact_extend/static/src/js/contactus.js
@ -1,40 +1,39 @@ |
|||||
odoo.define('website_contact_extend.success_page', function (require) { |
|
||||
|
odoo.define('website_contact_extend.success_page', function(require) { |
||||
"use strict"; |
"use strict"; |
||||
|
|
||||
var ajax = require("web.ajax"); |
var ajax = require("web.ajax"); |
||||
|
|
||||
// function check_user_exists(){
|
|
||||
// }
|
|
||||
|
|
||||
$(document).on('blur', '.input_email_from', function (ev) { |
|
||||
|
$(document).on('blur', '.input_email_from', function(ev) { |
||||
var email_from = $('.input_email_from').val(); |
var email_from = $('.input_email_from').val(); |
||||
var company_name = $('.input_company').val(); |
var company_name = $('.input_company').val(); |
||||
|
|
||||
return ajax.jsonRpc('/check_user_exists', 'call', { |
return ajax.jsonRpc('/check_user_exists', 'call', { |
||||
email_from: email_from, |
email_from: email_from, |
||||
company_name: company_name, |
company_name: company_name, |
||||
}).then(function (res) { |
|
||||
|
}).then(function(res) { |
||||
var contactus_page = "/contactus-thank-you"; |
var contactus_page = "/contactus-thank-you"; |
||||
if(res){ |
|
||||
|
if (res) { |
||||
contactus_page = "/contact-us-form-review"; |
contactus_page = "/contact-us-form-review"; |
||||
} |
} |
||||
$('form[action="/website_form/"]').attr('data-success_page',contactus_page); |
|
||||
|
var formaction_webform = 'form[action="/website_form/"]'; |
||||
|
$(formaction_webform).attr('data-success_page', contactus_page); |
||||
}); |
}); |
||||
}); |
}); |
||||
|
|
||||
$(document).on('blur', '.input_company', function (ev) { |
|
||||
|
$(document).on('blur', '.input_company', function(ev) { |
||||
var email_from = $('.input_email_from').val(); |
var email_from = $('.input_email_from').val(); |
||||
var company_name = $('.input_company').val(); |
var company_name = $('.input_company').val(); |
||||
|
|
||||
return ajax.jsonRpc('/check_user_exists', 'call', { |
return ajax.jsonRpc('/check_user_exists', 'call', { |
||||
email_from: email_from, |
email_from: email_from, |
||||
company_name: company_name, |
company_name: company_name, |
||||
}).then(function (res) { |
|
||||
|
}).then(function(res) { |
||||
var contactus_page = "/contactus-thank-you"; |
var contactus_page = "/contactus-thank-you"; |
||||
if(res){ |
|
||||
|
if (res) { |
||||
contactus_page = "/contact-us-form-review"; |
contactus_page = "/contact-us-form-review"; |
||||
} |
} |
||||
$('form[action="/website_form/"]').attr('data-success_page',contactus_page); |
|
||||
|
var formaction_webform = 'form[action="/website_form/"]'; |
||||
|
$(formaction_webform).attr('data-success_page', contactus_page); |
||||
}); |
}); |
||||
}); |
}); |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue