This commit is contained in:
2025-08-19 15:05:55 +07:00
parent 70ae66ee4b
commit f78dc34aee
161 changed files with 13703 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
from . import ir_action
from . import ir_ui_view
from . import cheat_web
from . import res_users_settings
+29
View File
@@ -0,0 +1,29 @@
# Do not forget to add this file to __init__.py
# Refer to https://www.odoo.com/documentation/17.0/contributing/development/coding_guidelines.html for coding guidelines
from odoo import _, fields, models, api
class CheatWeb(models.Model):
_name = "cheat.web"
char_field = fields.Char(string="Char Field", required=True)
int_field = fields.Integer(string="Integer Field")
def do_something(self):
return { "result": "Ok" }
def do_something_else(self, param1 = 0, param2 = 1):
return {
"result": "Ok",
"param1": param1,
"param2": param2
}
@api.model
def do_model_method(self, param1 = 0, param2 = 1):
return {
"result": "Ok",
"param1": param1,
"param2": param2
}
+11
View File
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from odoo import fields, models
class ActWindowView(models.Model):
_inherit = 'ir.actions.act_window.view'
view_mode = fields.Selection(selection_add=[
('hello', "Hello"),
('statistic', "Statistic"),
('cheat', "Cheat")
], ondelete={'hello': 'cascade', 'statistic': 'cascade', 'cheat': 'cascade'})
+25
View File
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
import logging
from odoo import fields, models
_logger = logging.getLogger(__name__)
class View(models.Model):
_inherit = 'ir.ui.view'
type = fields.Selection(selection_add=[
('hello', "Hello"),
('statistic', 'Statistic'),
('cheat', "Cheat")
]
)
def _validate_tag_cheat(self, node, name_manager, node_info):
_logger.info("----------Cheat view validation")
def _get_view_info(self):
return {
'hello': {'icon': 'fa fa-smile-o'},
'statistic': {'icon': 'fa fa-info'},
'cheat': {'icon': 'fa fa-bookmark-o'}
} | super()._get_view_info()
+8
View File
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from odoo import fields, models
class Users(models.Model):
_inherit = 'res.users.settings'
cheat_web_user_setting_char_field = fields.Char("User Char Field", default="default")
cheat_web_user_setting_integer_field = fields.Integer("User Integer Field", default=0)