23 lines
691 B
Python
23 lines
691 B
Python
|
|
# from odoo import http
|
||
|
|
# from odoo.http import request
|
||
|
|
#
|
||
|
|
#
|
||
|
|
# class SurveyController(http.Controller):
|
||
|
|
#
|
||
|
|
# @http.route()
|
||
|
|
# def fill(self, survey, *args, **kwargs):
|
||
|
|
# response = super().fill(survey, *args, **kwargs)
|
||
|
|
#
|
||
|
|
# # Inject JavaScript
|
||
|
|
# js_code = """
|
||
|
|
# <script>
|
||
|
|
# document.addEventListener('DOMContentLoaded', function() {
|
||
|
|
# console.log('Survey validation loaded');
|
||
|
|
# // ... your validation code here ...
|
||
|
|
# });
|
||
|
|
# </script>
|
||
|
|
# """
|
||
|
|
#
|
||
|
|
# # Inject before </body>
|
||
|
|
# response.set_data(response.get_data(as_text=True).replace('</body>', js_code + '</body>'))
|
||
|
|
# return response
|