上传修改后的主题
This commit is contained in:
16
spiffy_theme_backend/models/__init__.py
Normal file
16
spiffy_theme_backend/models/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
|
||||
from . import backend_configurator
|
||||
from . import res_users
|
||||
from . import res_company
|
||||
from . import res_config_setting
|
||||
from . import ir_menu
|
||||
from . import favorite_apps
|
||||
from . import bookmark
|
||||
from . import multi_tab
|
||||
from . import ir_http
|
||||
from . import pwa_shortcuts
|
||||
from . import to_do_list
|
||||
from . import ir_module
|
||||
160
spiffy_theme_backend/models/backend_configurator.py
Normal file
160
spiffy_theme_backend/models/backend_configurator.py
Normal file
@@ -0,0 +1,160 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
|
||||
from odoo.modules.module import get_resource_path
|
||||
from odoo import api, fields, models, tools, _
|
||||
from odoo.exceptions import UserError
|
||||
import base64
|
||||
|
||||
class BackendConfig(models.Model):
|
||||
_name = 'backend.config'
|
||||
_description = "Configurator Backend Theme"
|
||||
|
||||
def _default_app_drawer_bg_image(self):
|
||||
image_path = get_resource_path(
|
||||
'spiffy_theme_backend', 'static/description', 'app-drawer-bg-image.png')
|
||||
with tools.file_open(image_path, 'rb') as f:
|
||||
return base64.b64encode(f.read())
|
||||
|
||||
use_custom_colors = fields.Boolean(string="Use Custom Colors")
|
||||
use_custom_drawer_color = fields.Boolean(string="Use Custom Drawer Colors")
|
||||
|
||||
tree_form_split_view = fields.Boolean(string="Tree Form Split View")
|
||||
|
||||
color_pallet = fields.Selection([
|
||||
('pallet_1', 'Color Pallet 1'),
|
||||
('pallet_2', 'Color Pallet 2'),
|
||||
('pallet_3', 'Color Pallet 3'),
|
||||
('pallet_4', 'Color Pallet 4'),
|
||||
('pallet_5', 'Color Pallet 5'),
|
||||
('pallet_6', 'Color Pallet 6'),
|
||||
('pallet_7', 'Color Pallet 7'),
|
||||
('pallet_8', 'Color Pallet 8'),
|
||||
('pallet_9', 'Color Pallet 9'),
|
||||
],default="pallet_9", string="Color Pallets")
|
||||
|
||||
drawer_color_pallet = fields.Selection([
|
||||
('drawer_pallet_1', 'Color Pallet 1'),
|
||||
('drawer_pallet_2', 'Color Pallet 2'),
|
||||
('drawer_pallet_3', 'Color Pallet 3'),
|
||||
('drawer_pallet_4', 'Color Pallet 4'),
|
||||
('drawer_pallet_5', 'Color Pallet 5'),
|
||||
('drawer_pallet_6', 'Color Pallet 6'),
|
||||
('drawer_pallet_7', 'Color Pallet 7'),
|
||||
('drawer_pallet_8', 'Color Pallet 8'),
|
||||
('drawer_pallet_9', 'Color Pallet 9'),
|
||||
],default="drawer_pallet_9", string="Drawer Color Pallets")
|
||||
|
||||
appdrawer_custom_bg_color = fields.Char(string="App Drawer Custom Background Color",default="#0097a7")
|
||||
appdrawer_custom_text_color = fields.Char(string="App Drawer Custom Text Color",default="#ffffff")
|
||||
|
||||
light_primary_bg_color = fields.Char(string="Primary Background Color for light",default="#0097a7")
|
||||
light_primary_text_color = fields.Char(string="Primary Text Color for light",default="#ffffff")
|
||||
|
||||
apply_light_bg_img = fields.Boolean(string="Apply light bg image")
|
||||
light_bg_image = fields.Binary(string="Background Image For light", default=_default_app_drawer_bg_image, readonly=False)
|
||||
|
||||
dark_primary_bg_color = fields.Char(string="Primary Background Color for dark",default="#0097a7")
|
||||
dark_primary_text_color = fields.Char(string="Primary Text Color for dark",default="#ffffff")
|
||||
|
||||
dark_secondry_bg_color = fields.Char(string="Secondry Background Color for dark",default="#242424")
|
||||
dark_secondry_text_color = fields.Char(string="Secondry Text Color for dark",default="#ffffff")
|
||||
|
||||
dark_body_bg_color = fields.Char(string="Body Background Color for dark",default="#1d1d1d")
|
||||
dark_body_text_color = fields.Char(string="Body Text Color for dark",default="#ffffff")
|
||||
|
||||
separator = fields.Selection([
|
||||
('separator_style_1', 'Separator Style 1'),
|
||||
('separator_style_2', 'Separator Style 2'),
|
||||
('separator_style_3', 'Separator Style 3'),
|
||||
('separator_style_4', 'Separator Style 4')],
|
||||
default="separator_style_2", string="Separator Styles")
|
||||
|
||||
tab = fields.Selection([
|
||||
('tab_style_1', 'Tab Style 1'),
|
||||
('tab_style_2', 'Tab Style 2'),
|
||||
('tab_style_3', 'Tab Style 3'),
|
||||
('tab_style_4', 'Tab Style 4')],
|
||||
default="tab_style_1", string="Tab Styles")
|
||||
|
||||
checkbox = fields.Selection([
|
||||
('checkbox_style_1', 'Checkbox Style 1'),
|
||||
('checkbox_style_2', 'Checkbox Style 2'),
|
||||
('checkbox_style_3', 'Checkbox Style 3'),
|
||||
('checkbox_style_4', 'Checkbox Style 4')],
|
||||
default="checkbox_style_4", string="Checkbox Styles")
|
||||
|
||||
radio = fields.Selection([
|
||||
('radio_style_1', 'Radio Style 1'),
|
||||
('radio_style_2', 'Radio Style 2'),
|
||||
('radio_style_3', 'Radio Style 3'),
|
||||
('radio_style_4', 'Radio Style 4')],
|
||||
default="radio_style_1", string="Radio Styles")
|
||||
|
||||
popup = fields.Selection([
|
||||
('popup_style_1', 'popup Style 1'),
|
||||
('popup_style_2', 'popup Style 2'),
|
||||
('popup_style_3', 'popup Style 3'),
|
||||
('popup_style_4', 'popup Style 4')],
|
||||
default="popup_style_2", string="popup Styles")
|
||||
|
||||
chatter_position = fields.Selection([
|
||||
('chatter_right', 'Chatter Right'),
|
||||
('chatter_bottom', 'Chatter Bottom')],
|
||||
default="chatter_right", string="Chatter Position")
|
||||
|
||||
top_menu_position = fields.Selection([
|
||||
('top_menu_horizontal', 'Top Menu Horizontal'),
|
||||
('top_menu_vertical', 'Top Menu Vertical')],
|
||||
default="top_menu_vertical", string="Top Menu Position")
|
||||
|
||||
theme_style = fields.Selection([
|
||||
('biz_theme_rounded', 'Rounded Theme'),
|
||||
('biz_theme_standard', 'Standard Theme'),
|
||||
('biz_theme_square', 'Square Theme')],
|
||||
default="biz_theme_rounded", string="Theme Style")
|
||||
|
||||
attachment_in_tree_view = fields.Boolean(string="Show Attachement in tree view")
|
||||
|
||||
font_size = fields.Selection([
|
||||
('font_small', 'Font Small'),
|
||||
('font_medium', 'Font Medium'),
|
||||
('font_large', 'Font large')],
|
||||
default="font_medium", string="Font size")
|
||||
|
||||
loader_style = fields.Selection([
|
||||
('loader_style_1', 'Loader Style 1'),
|
||||
('loader_style_2', 'Loader Style 2'),
|
||||
('loader_style_3', 'Loader Style 3'),
|
||||
('loader_style_4', 'Loader Style 4'),
|
||||
('loader_style_5', 'Loader Style 5'),
|
||||
('loader_style_6', 'Loader Style 6'),
|
||||
('loader_style_7', 'Loader Style 7'),
|
||||
('loader_style_8', 'Loader Style 8'),
|
||||
('loader_style_9', 'Loader Style 9'),
|
||||
('loader_style_10', 'Loader Style 10'),],
|
||||
default="loader_style_10", string="Loader Styles")
|
||||
|
||||
font_family = fields.Selection([
|
||||
('lato', 'Lato'),
|
||||
('montserrat', 'Montserrat'),
|
||||
('open_sans', 'Open Sans'),
|
||||
('oswald', 'Oswald'),
|
||||
('raleway', 'Raleway'),
|
||||
('roboto', 'Roboto'),
|
||||
('poppins', 'Poppins'),
|
||||
('rubik', 'Rubik'),
|
||||
('inter', 'Inter'),
|
||||
('josefin_sans', 'Josefin Sans'),
|
||||
('varela_round', 'Varela Round'),
|
||||
('manrope', 'Manrope'),
|
||||
('Nunito_Sans', 'Nunito Sans')],
|
||||
default="rubik", string="Font Family")
|
||||
|
||||
list_view_density = fields.Selection([
|
||||
('list_comfortable', 'Comfortable'),
|
||||
('list_compact', 'Compact'),],
|
||||
default="list_comfortable", string="List View Density")
|
||||
|
||||
list_view_sticky_header = fields.Boolean(string="List view Sticky Header")
|
||||
14
spiffy_theme_backend/models/bookmark.py
Normal file
14
spiffy_theme_backend/models/bookmark.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo Module Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class Bookmarklink(models.Model):
|
||||
_name = 'bookmark.link'
|
||||
_description = "Bookmark Link"
|
||||
|
||||
name = fields.Char("Name")
|
||||
title = fields.Char("Title")
|
||||
url = fields.Char("URL")
|
||||
user_id = fields.Many2one('res.users')
|
||||
15
spiffy_theme_backend/models/favorite_apps.py
Normal file
15
spiffy_theme_backend/models/favorite_apps.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo Module Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class FavoriteApps(models.Model):
|
||||
_name = "favorite.apps"
|
||||
_description = "Favorite Apps"
|
||||
|
||||
name = fields.Char("Name")
|
||||
app_id = fields.Char("App Id")
|
||||
app_xmlid = fields.Char("App XML Id")
|
||||
app_actionid = fields.Char("App Action Id")
|
||||
user_id = fields.Many2one('res.users')
|
||||
31
spiffy_theme_backend/models/ir_http.py
Normal file
31
spiffy_theme_backend/models/ir_http.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.http import request
|
||||
|
||||
class Http(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
|
||||
def session_info(self):
|
||||
# Show company change option even if single company available
|
||||
is_bg_color = self.env.user.table_color
|
||||
res = super(Http, self).session_info()
|
||||
# user = request.env.user
|
||||
company = self.env.company
|
||||
|
||||
session_sid = request.session.sid
|
||||
if self.env.user.image_1920:
|
||||
image = self.env.user.image_1920.decode('utf-8')
|
||||
else:
|
||||
image = ''
|
||||
res.update({'bg_color':is_bg_color,'user_image':image,'session_sid':session_sid,'spiffy_installed':True})
|
||||
|
||||
if self.env.user.has_group('base.group_user'):
|
||||
res.update({
|
||||
"display_switch_company_menu": True,
|
||||
"prevent_auto_save_warning_msg": company.prevent_auto_save_warning if company.prevent_auto_save_warning else '',
|
||||
})
|
||||
|
||||
return res
|
||||
12
spiffy_theme_backend/models/ir_menu.py
Normal file
12
spiffy_theme_backend/models/ir_menu.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class IrUiMenu(models.Model):
|
||||
_inherit = "ir.ui.menu"
|
||||
|
||||
icon_img = fields.Image("Menu New Image")
|
||||
use_icon = fields.Boolean("Use Icon")
|
||||
icon_class_name = fields.Char("Icon Class Name")
|
||||
31
spiffy_theme_backend/models/ir_module.py
Normal file
31
spiffy_theme_backend/models/ir_module.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details
|
||||
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
class Module(models.Model):
|
||||
_inherit = "ir.module.module"
|
||||
|
||||
def next(self):
|
||||
"""
|
||||
Return the action linked to an ir.actions.todo is there exists one that
|
||||
should be executed. Otherwise, redirect to /web
|
||||
"""
|
||||
Todos = self.env['ir.actions.todo']
|
||||
active_todo = Todos.search([('state', '=', 'open')], limit=1)
|
||||
if active_todo:
|
||||
return active_todo.action_launch()
|
||||
if request.env.user.table_color:
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'self',
|
||||
'url': '/web?bg_color=True&tool_color_id=1',
|
||||
}
|
||||
else:
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'self',
|
||||
'url': '/web',
|
||||
}
|
||||
16
spiffy_theme_backend/models/multi_tab.py
Normal file
16
spiffy_theme_backend/models/multi_tab.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo Module Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class MultiTab(models.Model):
|
||||
_name = 'biz.multi.tab'
|
||||
_description = "Multi Tab"
|
||||
|
||||
name = fields.Char("App Name")
|
||||
url = fields.Char("URL")
|
||||
actionId = fields.Char("Action ID")
|
||||
menuId = fields.Char("Menu ID")
|
||||
user_id = fields.Many2one('res.users')
|
||||
menu_xmlid = fields.Char("XML ID Name")
|
||||
15
spiffy_theme_backend/models/pwa_shortcuts.py
Normal file
15
spiffy_theme_backend/models/pwa_shortcuts.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
class PWAshortcuts(models.Model):
|
||||
_name = 'pwa.shortcuts'
|
||||
_description = "PWA Shortcuts"
|
||||
|
||||
name = fields.Char("Name", required=True)
|
||||
short_name = fields.Char("Short Name", required=True)
|
||||
url = fields.Char("URL", required=True, default='/')
|
||||
description = fields.Char("Description", required=True)
|
||||
image_192_shortcut = fields.Binary('Image 192px', readonly=False)
|
||||
70
spiffy_theme_backend/models/res_company.py
Normal file
70
spiffy_theme_backend/models/res_company.py
Normal file
@@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
|
||||
import base64
|
||||
from odoo import api, http, fields, models, tools
|
||||
from odoo.http import request
|
||||
from odoo.modules.module import get_resource_path
|
||||
from odoo.tools.translate import _
|
||||
|
||||
class Company(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
tab_name = fields.Char(string="Backend Tab Name", default="Spiffy", readonly=False)
|
||||
backend_theme_level = fields.Selection([
|
||||
('user_level', 'User Level'),
|
||||
('global_level', 'Global Level')],
|
||||
default="user_level", required=True, string="Backend Theme Level", readonly=False)
|
||||
|
||||
login_page_style = fields.Selection([
|
||||
('login_style_1', 'Login Style 1'),
|
||||
('login_style_2', 'Login Style 2'),
|
||||
('login_style_3', 'Login Style 3'),
|
||||
('login_style_4', 'Login Style 4')],
|
||||
default="login_style_1", required=True, string="Login Styles", readonly=False)
|
||||
|
||||
login_page_background_img = fields.Binary('Login Background Image', readonly=False, store=True)
|
||||
login_page_background_color = fields.Char('Login Background Color', default="#f2f6ff", readonly=False)
|
||||
login_page_text_color = fields.Char('Login Text Color', default="#777777", readonly=False)
|
||||
show_bg_image = fields.Boolean(string='Add Login Background Image', readonly=False)
|
||||
|
||||
def get_login_page_data(self):
|
||||
admin_users = request.env['res.users'].sudo().search([
|
||||
('groups_id','in',request.env.ref('base.user_admin').id),
|
||||
('backend_theme_config','!=',False),
|
||||
], order="id asc", limit=1)
|
||||
admin_config = False
|
||||
if admin_users:
|
||||
admin_config = admin_users.backend_theme_config
|
||||
|
||||
if admin_config:
|
||||
config_vals = admin_config
|
||||
else:
|
||||
config_vals = request.env['backend.config'].sudo().search([], order="id asc", limit=1)
|
||||
|
||||
values = {
|
||||
'config_vals': config_vals,
|
||||
}
|
||||
return values
|
||||
|
||||
backend_menubar_logo = fields.Binary(
|
||||
string="Menubar Logo", readonly=False)
|
||||
backend_menubar_logo_icon = fields.Binary(
|
||||
string="Menubar Logo Icon", readonly=False)
|
||||
|
||||
enable_pwa = fields.Boolean(string='Enable PWA', readonly=False)
|
||||
app_name_pwa = fields.Char('App Name', readonly=False, default='Spiffy')
|
||||
short_name_pwa = fields.Char('Short Name', readonly=False, default='Spiffy')
|
||||
description_pwa = fields.Char('App Description', readonly=False, default='Spiffy')
|
||||
image_192_pwa = fields.Binary('Image 192px', readonly=False, store=True)
|
||||
image_512_pwa = fields.Binary('Image 512px', readonly=False, store=True)
|
||||
start_url_pwa = fields.Char('App Start Url', readonly=False, default='/web')
|
||||
background_color_pwa = fields.Char('Background Color', readonly=False, default='#0097a7')
|
||||
theme_color_pwa = fields.Char('Theme Color', readonly=False, default='#0097a7')
|
||||
pwa_shortcuts_ids = fields.Many2many('pwa.shortcuts', string='PWA Shortcuts')
|
||||
|
||||
spiffy_toobar_color = fields.Char('Toolbar Color', readonly=False, default='#0097a7')
|
||||
prevent_auto_save = fields.Boolean(string='Prevent Auto Save', readonly=False)
|
||||
|
||||
prevent_auto_save_warning = fields.Char('Auto Save Warning', translate=True, default="Autosave is disabled, Click on save button.", readonly=False)
|
||||
69
spiffy_theme_backend/models/res_config_setting.py
Normal file
69
spiffy_theme_backend/models/res_config_setting.py
Normal file
@@ -0,0 +1,69 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
# Developed by Bizople Solutions Pvt. Ltd.
|
||||
|
||||
from odoo.modules.module import get_resource_path
|
||||
from odoo import api, http, fields, models, tools, _
|
||||
from odoo.http import request
|
||||
import base64
|
||||
|
||||
class ResConfig(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
spiffy_favicon = fields.Binary(related='company_id.favicon',
|
||||
string="Backend Tab Favicon", readonly=False)
|
||||
tab_name = fields.Char(related='company_id.tab_name',
|
||||
string="Backend Tab Name", readonly=False)
|
||||
backend_theme_level = fields.Selection(
|
||||
related='company_id.backend_theme_level', string="Backend Theme Level", required=True, readonly=False)
|
||||
|
||||
login_page_style = fields.Selection(
|
||||
related='company_id.login_page_style', string="Login Styles", required=True, readonly=False)
|
||||
|
||||
login_page_background_img = fields.Binary(
|
||||
related='company_id.login_page_background_img', string="Login Background Image", readonly=False)
|
||||
|
||||
login_page_background_color = fields.Char(
|
||||
related='company_id.login_page_background_color', string='Login Background Color', readonly=False)
|
||||
|
||||
login_page_text_color = fields.Char(
|
||||
related='company_id.login_page_text_color', string='Login Text Color', readonly=False)
|
||||
|
||||
show_bg_image = fields.Boolean(
|
||||
related='company_id.show_bg_image', string='Add Login Background Image', readonly=False)
|
||||
|
||||
backend_menubar_logo = fields.Binary(
|
||||
related='company_id.backend_menubar_logo', string="Menubar Logo", readonly=False)
|
||||
|
||||
backend_menubar_logo_icon = fields.Binary(
|
||||
related='company_id.backend_menubar_logo_icon', string="Menubar Logo Icon", readonly=False)
|
||||
|
||||
# Fields for PWA start
|
||||
enable_pwa = fields.Boolean(
|
||||
string='Enable PWA', related='company_id.enable_pwa', readonly=False,)
|
||||
app_name_pwa = fields.Char(
|
||||
'App Name', related='company_id.app_name_pwa', readonly=False)
|
||||
short_name_pwa = fields.Char(
|
||||
'Short Name', related='company_id.short_name_pwa', readonly=False)
|
||||
description_pwa = fields.Char(
|
||||
'App Description', related='company_id.description_pwa', readonly=False)
|
||||
image_192_pwa = fields.Binary(
|
||||
'Image 192px', related='company_id.image_192_pwa', readonly=False)
|
||||
image_512_pwa = fields.Binary(
|
||||
'Image 512px', related='company_id.image_512_pwa', readonly=False)
|
||||
start_url_pwa = fields.Char(
|
||||
'App Start Url', related='company_id.start_url_pwa', readonly=False)
|
||||
background_color_pwa = fields.Char(
|
||||
'Background Color', related='company_id.background_color_pwa', readonly=False)
|
||||
theme_color_pwa = fields.Char(
|
||||
'Theme Color', related='company_id.theme_color_pwa', readonly=False)
|
||||
pwa_shortcuts_ids = fields.Many2many(
|
||||
related='company_id.pwa_shortcuts_ids', readonly=False)
|
||||
# Fields for PWA end
|
||||
|
||||
spiffy_toobar_color = fields.Char('Toolbar Color', related='company_id.spiffy_toobar_color', readonly=False)
|
||||
|
||||
prevent_auto_save = fields.Boolean(
|
||||
related='company_id.prevent_auto_save', string='Prevent Auto Save ?', readonly=False)
|
||||
|
||||
prevent_auto_save_warning = fields.Char('Auto Save Warning', related='company_id.prevent_auto_save_warning', readonly=False)
|
||||
27
spiffy_theme_backend/models/res_users.py
Normal file
27
spiffy_theme_backend/models/res_users.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo Module Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class User(models.Model):
|
||||
_inherit = "res.users"
|
||||
|
||||
app_ids = fields.One2many('favorite.apps', 'user_id',string="Favorite Apps")
|
||||
bookmark_ids = fields.One2many('bookmark.link', 'user_id',string="Bookmark Links")
|
||||
dark_mode = fields.Boolean(string="Is dark Mode Active", default=False)
|
||||
vertical_sidebar_pinned = fields.Boolean(string="Pinned Sidebar", default=True)
|
||||
backend_theme_config = fields.Many2one('backend.config', string="Backend Config", copy=False)
|
||||
multi_tab_ids = fields.One2many('biz.multi.tab', 'user_id', string="Multi Tabs")
|
||||
enable_todo_list = fields.Boolean(string="Enable To Do List", default=True)
|
||||
todo_list_ids = fields.One2many('todo.list', 'user_id', string="To Do List")
|
||||
table_color = fields.Boolean(string="Is Body Color")
|
||||
tool_color_id = fields.Char(string="Tool Color")
|
||||
|
||||
@property
|
||||
def SELF_READABLE_FIELDS(self):
|
||||
return super().SELF_READABLE_FIELDS + ['enable_todo_list']
|
||||
|
||||
@property
|
||||
def SELF_WRITEABLE_FIELDS(self):
|
||||
return super().SELF_WRITEABLE_FIELDS + ['enable_todo_list']
|
||||
30
spiffy_theme_backend/models/to_do_list.py
Normal file
30
spiffy_theme_backend/models/to_do_list.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo Module Developed by Bizople Solutions Pvt. Ltd.
|
||||
# See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
class ToDoList(models.Model):
|
||||
_name = "todo.list"
|
||||
_description = "To Do List"
|
||||
_order = 'write_date desc, create_date desc'
|
||||
|
||||
def _default_sequence(self):
|
||||
return (self.search([], order="sequence desc", limit=1).sequence or 0) + 1
|
||||
|
||||
sequence = fields.Integer('sequence', default=_default_sequence)
|
||||
name = fields.Char("Title")
|
||||
description = fields.Html('Description')
|
||||
# marked_done = fields.Boolean("Done?")
|
||||
user_id = fields.Many2one('res.users', string="User")
|
||||
create_date = fields.Datetime(string="Created on")
|
||||
write_date = fields.Datetime("Last Updated On", index=True)
|
||||
note_color_pallet = fields.Selection([
|
||||
('pallet_1', 'Pallet 1'),
|
||||
('pallet_2', 'Pallet 2'),
|
||||
('pallet_3', 'Pallet 3'),
|
||||
('pallet_4', 'Pallet 4'),
|
||||
('pallet_5', 'Pallet 5'),
|
||||
('pallet_6', 'Pallet 6'),
|
||||
('pallet_7', 'Pallet 7'),
|
||||
],default="pallet_1", string="Notes Color Pallets", required=True)
|
||||
Reference in New Issue
Block a user