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
+1
View File
@@ -0,0 +1 @@
from . import controllers
+32
View File
@@ -0,0 +1,32 @@
{
'name': "debrand_module",
'summary': "Short (1 phrase/line) summary of the module's purpose",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website': "https://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base','survey'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/survey_debrand.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}
+1
View File
@@ -0,0 +1 @@
from . import controllers
+21
View File
@@ -0,0 +1,21 @@
# from odoo import http
# class DebrandModule(http.Controller):
# @http.route('/debrand_module/debrand_module', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/debrand_module/debrand_module/objects', auth='public')
# def list(self, **kw):
# return http.request.render('debrand_module.listing', {
# 'root': '/debrand_module/debrand_module',
# 'objects': http.request.env['debrand_module.debrand_module'].search([]),
# })
# @http.route('/debrand_module/debrand_module/objects/<model("debrand_module.debrand_module"):obj>', auth='public')
# def object(self, obj, **kw):
# return http.request.render('debrand_module.object', {
# 'object': obj
# })
+30
View File
@@ -0,0 +1,30 @@
<odoo>
<data>
<!--
<record id="object0" model="debrand_module.debrand_module">
<field name="name">Object 0</field>
<field name="value">0</field>
</record>
<record id="object1" model="debrand_module.debrand_module">
<field name="name">Object 1</field>
<field name="value">10</field>
</record>
<record id="object2" model="debrand_module.debrand_module">
<field name="name">Object 2</field>
<field name="value">20</field>
</record>
<record id="object3" model="debrand_module.debrand_module">
<field name="name">Object 3</field>
<field name="value">30</field>
</record>
<record id="object4" model="debrand_module.debrand_module">
<field name="name">Object 4</field>
<field name="value">40</field>
</record>
-->
</data>
</odoo>
+1
View File
@@ -0,0 +1 @@
from . import models
+24
View File
@@ -0,0 +1,24 @@
from odoo import models, fields, api
class SurveyQuestionAnswer(models.Model):
_inherit = 'survey.question.answer'
# Add a computed field for Khmer label
khmer_label = fields.Char(string='Khmer Label', compute='_compute_khmer_label')
def _compute_khmer_label(self):
# Khmer numerals mapping
khmer_numerals = {
'A': '', 'B': '', 'C': '', 'D': '',
'E': '', 'F': '', 'G': '', 'H': '',
'I': '', 'J': '១០'
}
for answer in self:
# Get the first character of the answer
label = answer.answer_row or ''
if label and label[0].upper() in khmer_numerals:
answer.khmer_label = khmer_numerals[label[0].upper()]
else:
answer.khmer_label = label
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_debrand_module_debrand_module,debrand_module.debrand_module,model_debrand_module_debrand_module,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_debrand_module_debrand_module debrand_module.debrand_module model_debrand_module_debrand_module base.group_user 1 1 1 1
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="MYSITE_layout" inherit_id="web.layout" name="Web layout">
<xpath expr="//head//title" position="before">
<title t-esc="'CYCPP'"/>
</xpath>
<xpath expr="//head//link" position="replace">
<link rel="shortcut icon" href="/debrand_module/static/src/img/favicon.ico" type="image/x-icon"/>
</xpath>
</template>
</odoo>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Override survey question template -->
<template id="survey_question_custom" inherit_id="survey.question">
<xpath expr="//div[@class='o_survey_question_answers']" position="replace">
<div class="o_survey_question_answers">
<t t-foreach="question.suggested_answer_ids" t-as="answer">
<div class="form-check">
<input type="radio"
t-attf-name="question_{{question.id}}"
t-att-value="answer.id"
class="form-check-input"
t-att-id="'answer_' + str(answer.id)"/>
<label t-att-for="'answer_' + str(answer.id)" class="form-check-label">
<!-- Display Khmer numeral -->
<t t-set="khmer_map" t-value="{'A': '១', 'B': '២', 'C': '៣', 'D': '៤', 'E': '៥', 'F': '៦', 'G': '៧', 'H': '៨', 'I': '៩', 'J': '១០'}"/>
<t t-esc="khmer_map.get(answer.answer_row[:1].upper(), answer.answer_row[:1])"/>
<t t-esc="answer.answer_row[1:] if len(answer.answer_row) &gt; 1 else ''"/>
</label>
</div>
</t>
</div>
</xpath>
</template>
</odoo>