update
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
from . import ir_action
|
||||
from . import ir_ui_view
|
||||
from . import cheat_web
|
||||
from . import res_users_settings
|
||||
@@ -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
|
||||
}
|
||||
@@ -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'})
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user