first push message

This commit is contained in:
2026-07-01 14:41:49 +07:00
parent 6667dec2bf
commit 58b5f46cc4
2951 changed files with 316619 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import json
from odoo import http
from odoo.http import request
class SurveyDashboardController(http.Controller):
@http.route('/survey/dashboard/<int:survey_id>', type='http', auth='user', website=True)
def dashboard_view(self, survey_id, **kw):
survey = request.env['survey.survey'].sudo().browse(survey_id).exists()
if not survey:
return request.not_found()
# Get data from model
data = survey.get_dashboard_data()
# ✅ CRITICAL: Serialize to JSON string with UTF-8 support for Khmer text
data['questions_json'] = json.dumps(
data.get('questions', []),
default=str,
ensure_ascii=False
)
return request.render('dashboard_survey.dashboard_template', data)