Browse Source

publish muk_web_theme

16.0
Mathias Markl 1 year ago
parent
commit
d59fea5a47
  1. 46
      README.md
  2. 24
      muk_web_theme/__init__.py
  3. 54
      muk_web_theme/__manifest__.py
  4. 24
      muk_web_theme/models/__init__.py
  5. 37
      muk_web_theme/models/ir_http.py
  6. 66
      muk_web_theme/models/res_company.py
  7. 79
      muk_web_theme/models/res_config_settings.py
  8. 73
      muk_web_theme/models/res_users.py
  9. 57
      muk_web_theme/models/web_editor_assets.py
  10. BIN
      muk_web_theme/static/description/branding_mail_banner.png
  11. BIN
      muk_web_theme/static/description/branding_saas_banner.png
  12. BIN
      muk_web_theme/static/description/branding_website_banner.png
  13. 21
      muk_web_theme/static/description/index.html
  14. BIN
      muk_web_theme/static/description/screenshot.png
  15. BIN
      muk_web_theme/static/description/screenshot_apps.png
  16. BIN
      muk_web_theme/static/description/screenshot_chatter.png
  17. BIN
      muk_web_theme/static/description/screenshot_customize.png
  18. BIN
      muk_web_theme/static/description/screenshot_mobile_apps.png
  19. BIN
      muk_web_theme/static/description/screenshot_mobile_form.png
  20. BIN
      muk_web_theme/static/description/screenshot_mobile_kanban.png
  21. BIN
      muk_web_theme/static/description/screenshot_mobile_menu.png
  22. BIN
      muk_web_theme/static/description/screenshot_settings.png
  23. BIN
      muk_web_theme/static/description/service_customization.png
  24. BIN
      muk_web_theme/static/description/service_development.png
  25. BIN
      muk_web_theme/static/description/service_implementation.png
  26. BIN
      muk_web_theme/static/description/service_infrastructure.png
  27. BIN
      muk_web_theme/static/description/service_training.png
  28. 28
      muk_web_theme/static/src/colors.scss
  29. 25
      muk_web_theme/static/src/core/pager/pager.xml
  30. 64
      muk_web_theme/static/src/legacy/js/fields_relational.js
  31. 49
      muk_web_theme/static/src/legacy/js/form_renderer.js
  32. 49
      muk_web_theme/static/src/legacy/js/form_view.js
  33. 42
      muk_web_theme/static/src/legacy/js/kanban_column.js
  34. 44
      muk_web_theme/static/src/legacy/js/kanban_quick_create.js
  35. 271
      muk_web_theme/static/src/legacy/js/kanban_renderer.js
  36. 37
      muk_web_theme/static/src/legacy/js/kanban_view.js
  37. 50
      muk_web_theme/static/src/legacy/scss/calendar_view.scss
  38. 40
      muk_web_theme/static/src/legacy/scss/fields.scss
  39. 158
      muk_web_theme/static/src/legacy/scss/form_view.scss
  40. 100
      muk_web_theme/static/src/legacy/scss/kanban_view.scss
  41. 75
      muk_web_theme/static/src/legacy/scss/list_view.scss
  42. 38
      muk_web_theme/static/src/legacy/scss/settings_view.scss
  43. 108
      muk_web_theme/static/src/legacy/xml/views.xml
  44. 30
      muk_web_theme/static/src/mixins.scss
  45. 64
      muk_web_theme/static/src/search/control_panel/control_panel.js
  46. 243
      muk_web_theme/static/src/search/control_panel/control_panel.scss
  47. 299
      muk_web_theme/static/src/search/control_panel/control_panel.xml
  48. 22
      muk_web_theme/static/src/variables.scss
  49. 8
      muk_web_theme/static/src/views/form/form.scss
  50. 12
      muk_web_theme/static/src/views/list/list.scss
  51. 26
      muk_web_theme/static/src/webclient/appsbar/appsbar.js
  52. 22
      muk_web_theme/static/src/webclient/appsbar/appsbar.scss
  53. 34
      muk_web_theme/static/src/webclient/appsbar/appsbar.xml
  54. 27
      muk_web_theme/static/src/webclient/appsmenu/appsmenu.js
  55. 26
      muk_web_theme/static/src/webclient/appsmenu/appsmenu.scss
  56. 29
      muk_web_theme/static/src/webclient/appsmenu/appsmenu.xml
  57. 97
      muk_web_theme/static/src/webclient/appssearch/appssearch.js
  58. 50
      muk_web_theme/static/src/webclient/appssearch/appssearch.scss
  59. 39
      muk_web_theme/static/src/webclient/appssearch/appssearch.xml
  60. 89
      muk_web_theme/static/src/webclient/navbar/navbar.js
  61. 69
      muk_web_theme/static/src/webclient/navbar/navbar.scss
  62. 70
      muk_web_theme/static/src/webclient/navbar/navbar.xml
  63. 25
      muk_web_theme/templates/webclient.xml
  64. 106
      muk_web_theme/views/res_config_settings.xml
  65. 33
      muk_web_theme/views/res_users.xml

46
README.md

@ -1,6 +1,4 @@
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)
[![Nexus](https://img.shields.io/badge/Nexus-Install%20me-5d8da8.svg)](https://nexus.mukit.at/#browse/browse:odoo)
[![Weblate](https://img.shields.io/badge/Weblate-Translate%20me-0094E9.svg)](https://weblate.mukit.at)
[![Website](https://img.shields.io/badge/Website-Open%20me-243742.svg)](https://mukit.at/)
# MuK Odoo Web Modules
@ -16,35 +14,6 @@ log on to your Odoo server and go to the Apps menu. Trigger the debug
mode and update the list by clicking on the "Update Apps List" link. Now
install the module by clicking on the install button.
Another way to install this module is via the package management for
Python ([PyPI]).
To install our modules using the package manager make sure
[odoo-autodiscover] is installed correctly. Then open a console and
install the module by entering the following command:
`pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`
The module name consists of the Odoo version and the module name, where
underscores are replaced by a dash.
**Module:**
`odoo<version>-addon-<module_name>`
**Example:**
`sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo13-addon-muk-utils`
Once the installation has been successfully completed, the app is
already in the correct folder. Log on to your Odoo server and go to the
Apps menu. Trigger the debug mode and update the list by clicking on the
"Update Apps List" link. Now install the module by clicking on the
install button.
You can also view available Apps directly in our [repository] and find a
more detailed installation guide on our [website].
### Upgrade
To upgrade this module, you need to:
@ -52,18 +21,3 @@ To upgrade this module, you need to:
Download the module and add it to your Odoo addons folder. Restart the
server and log on to your Odoo server. Select the Apps menu and upgrade
the module by clicking on the upgrade button.
If you installed the module using the "pip" command, you can also update
the module in the same way. Just type the following command into the
console:
`pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`
When the process is finished, restart your server and update the
application in Odoo, just like you would normally.
[PyPI]: https://pypi.org/project/pip/
[odoo-autodiscover]: https://pypi.org/project/odoo-autodiscover/
[repository]: https://nexus.mukit.at/#browse/browse:odoo
[website]: https://mukit.at/page/open-source
[MuK IT]: https://www.mukit.at/

24
muk_web_theme/__init__.py

@ -1,31 +1,9 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from . import models
from odoo import api, SUPERUSER_ID
def _uninstall_reset_changes(cr, registry):
def _uninstall_cleanup(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
env['web_editor.assets'].reset_asset(
'/muk_web_theme/static/src/colors.scss',

54
muk_web_theme/__manifest__.py

@ -1,29 +1,7 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'MuK Backend Theme',
'summary': 'Odoo Community Backend Theme',
'version': '15.0.1.0.1',
'version': '16.0.1.0.0',
'category': 'Themes/Backend',
'license': 'LGPL-3',
'author': 'MuK IT',
@ -41,40 +19,36 @@
'web_enterprise',
],
'data': [
'templates/webclient.xml',
'views/res_config_settings_view.xml',
'views/res_users.xml',
'templates/webclient.xml',
'views/res_config_settings.xml',
'views/res_users.xml',
],
'assets': {
'web.assets_qweb': [
'muk_web_theme/static/src/**/*.xml',
],
'web._assets_primary_variables': [
'muk_web_theme/static/src/colors.scss',
(
'after',
'web/static/src/scss/primary_variables.scss',
'muk_web_theme/static/src/colors.scss'
),
],
'web._assets_backend_helpers': [
'muk_web_theme/static/src/variables.scss',
'muk_web_theme/static/src/mixins.scss',
],
'web.assets_backend': [
'muk_web_theme/static/src/core/**/*.xml',
'muk_web_theme/static/src/webclient/**/*.xml',
'muk_web_theme/static/src/webclient/**/*.scss',
'muk_web_theme/static/src/webclient/**/*.js',
'muk_web_theme/static/src/search/**/*.scss',
'muk_web_theme/static/src/search/**/*.js',
'muk_web_theme/static/src/legacy/**/*.scss',
'muk_web_theme/static/src/legacy/**/*.js',
'muk_web_theme/static/src/views/**/*.scss',
],
},
'images': [
'static/description/banner.png',
'static/description/theme_screenshot.png'
],
'external_dependencies': {
'python': [],
'bin': [],
},
'installable': True,
'application': False,
'application': True,
'auto_install': False,
'uninstall_hook': '_uninstall_reset_changes',
'uninstall_hook': '_uninstall_cleanup',
}

24
muk_web_theme/models/__init__.py

@ -1,27 +1,5 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from . import ir_http
from . import res_company
from . import res_config_settings
from . import res_users
from . import web_editor_assets
from . import ir_http

37
muk_web_theme/models/ir_http.py

@ -1,25 +1,3 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models
from odoo.http import request
@ -28,12 +6,15 @@ class IrHttp(models.AbstractModel):
_inherit = "ir.http"
#----------------------------------------------------------
# Functions
#----------------------------------------------------------
def session_info(self):
result = super(IrHttp, self).session_info()
company = request.session.uid and request.env.user.company_id
blend_mode = company and company.background_blend_mode or False
result.update(
theme_background_blend_mode=blend_mode or "normal",
theme_has_background_image=bool(company and company.background_image)
)
if request.env.user._is_internal():
for company in request.env.user.company_ids:
result['user_companies']['allowed_companies'][company.id].update({
'has_background_image': bool(company.background_image),
})
return result

66
muk_web_theme/models/res_company.py

@ -1,25 +1,3 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models, fields
@ -28,52 +6,10 @@ class ResCompany(models.Model):
_inherit = 'res.company'
#----------------------------------------------------------
# Database
# Fields
#----------------------------------------------------------
background_image = fields.Binary(
string='Apps Menu Background Image',
attachment=True
)
background_blend_mode = fields.Selection(
selection=[
('normal', 'Normal'),
('multiply', 'Multiply'),
('screen', 'Screen'),
('overlay', 'Overlay'),
('hard-light', 'Hard-light'),
('darken', 'Darken'),
('lighten', 'Lighten'),
('color-dodge', 'Color-dodge'),
('color-burn', 'Color-burn'),
('hard-light', 'Hard-light'),
('difference', 'Difference'),
('exclusion', 'Exclusion'),
('hue', 'Hue'),
('saturation', 'Saturation'),
('color', 'Color'),
('luminosity', 'Luminosity'),
],
string='Apps Menu Background Blend Mode',
default='normal'
)
default_sidebar_preference = fields.Selection(
selection=[
('invisible', 'Invisible'),
('small', 'Small'),
('large', 'Large')
],
string='Sidebar Type',
default='large'
)
default_chatter_preference = fields.Selection(
selection=[
('normal', 'Normal'),
('sided', 'Sided'),
],
string='Chatter Position',
default='sided'
)

79
muk_web_theme/models/res_config_settings.py

@ -1,25 +1,3 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
import re
import uuid
import base64
@ -32,7 +10,7 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
#----------------------------------------------------------
# Database
# Fields
#----------------------------------------------------------
theme_favicon = fields.Binary(
@ -45,21 +23,6 @@ class ResConfigSettings(models.TransientModel):
readonly=False
)
theme_background_blend_mode = fields.Selection(
related='company_id.background_blend_mode',
readonly=False
)
theme_default_sidebar_preference = fields.Selection(
related='company_id.default_sidebar_preference',
readonly=False
)
theme_default_chatter_preference = fields.Selection(
related='company_id.default_chatter_preference',
readonly=False
)
theme_color_brand = fields.Char(
string='Theme Brand Color'
)
@ -68,10 +31,6 @@ class ResConfigSettings(models.TransientModel):
string='Theme Primary Color'
)
theme_color_required = fields.Char(
string='Theme Required Color'
)
theme_color_menu = fields.Char(
string='Theme Menu Color'
)
@ -84,41 +43,50 @@ class ResConfigSettings(models.TransientModel):
string='Theme AppBar Background'
)
#----------------------------------------------------------
# Action
#----------------------------------------------------------
def action_reset_theme_assets(self):
self.env['web_editor.assets'].reset_asset(
'/muk_web_theme/static/src/colors.scss', 'web._assets_primary_variables',
)
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
#----------------------------------------------------------
# Functions
#----------------------------------------------------------
def set_values(self):
res = super(ResConfigSettings, self).set_values()
param = self.env['ir.config_parameter'].sudo()
variables = [
'o-brand-odoo',
'o-brand-primary',
'mk-required-color',
'mk-apps-color',
'mk-menu-color',
'mk-appbar-color',
'mk-appbar-background',
]
colors = self.env['web_editor.assets'].get_variables_values(
colors = self.env['web_editor.assets'].get_theme_variables_values(
'/muk_web_theme/static/src/colors.scss', 'web._assets_primary_variables', variables
)
colors_changed = []
colors_changed.append(self.theme_color_brand != colors['o-brand-odoo'])
colors_changed.append(self.theme_color_primary != colors['o-brand-primary'])
colors_changed.append(self.theme_color_required != colors['mk-required-color'])
colors_changed.append(self.theme_color_menu != colors['mk-apps-color'])
colors_changed.append(self.theme_color_menu != colors['mk-menu-color'])
colors_changed.append(self.theme_color_appbar_color != colors['mk-appbar-color'])
colors_changed.append(self.theme_color_appbar_background != colors['mk-appbar-background'])
if(any(colors_changed)):
variables = [
{'name': 'o-brand-odoo', 'value': self.theme_color_brand or "#243742"},
{'name': 'o-brand-primary', 'value': self.theme_color_primary or "#5D8DA8"},
{'name': 'mk-required-color', 'value': self.theme_color_required or "#d1dfe6"},
{'name': 'mk-apps-color', 'value': self.theme_color_menu or "#f8f9fa"},
{'name': 'mk-menu-color', 'value': self.theme_color_menu or "#f8f9fa"},
{'name': 'mk-appbar-color', 'value': self.theme_color_appbar_color or "#dee2e6"},
{'name': 'mk-appbar-background', 'value': self.theme_color_appbar_background or "#000000"},
]
self.env['web_editor.assets'].replace_variables_values(
self.env['web_editor.assets'].replace_theme_variables_values(
'/muk_web_theme/static/src/colors.scss', 'web._assets_primary_variables', variables
)
return res
@ -126,23 +94,20 @@ class ResConfigSettings(models.TransientModel):
@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
params = self.env['ir.config_parameter'].sudo()
variables = [
'o-brand-odoo',
'o-brand-primary',
'mk-required-color',
'mk-apps-color',
'mk-menu-color',
'mk-appbar-color',
'mk-appbar-background',
]
colors = self.env['web_editor.assets'].get_variables_values(
colors = self.env['web_editor.assets'].get_theme_variables_values(
'/muk_web_theme/static/src/colors.scss', 'web._assets_primary_variables', variables
)
res.update({
'theme_color_brand': colors['o-brand-odoo'],
'theme_color_primary': colors['o-brand-primary'],
'theme_color_required': colors['mk-required-color'],
'theme_color_menu': colors['mk-apps-color'],
'theme_color_menu': colors['mk-menu-color'],
'theme_color_appbar_color': colors['mk-appbar-color'],
'theme_color_appbar_background': colors['mk-appbar-background'],
})

73
muk_web_theme/models/res_users.py

@ -1,25 +1,3 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import models, fields, api
@ -28,19 +6,23 @@ class ResUsers(models.Model):
_inherit = 'res.users'
#----------------------------------------------------------
# Defaults
# Properties
#----------------------------------------------------------
@api.model
def _default_sidebar_type(self):
return self.env.user.company_id.default_sidebar_preference or 'large'
@api.model
def _default_chatter_position(self):
return self.env.user.company_id.default_chatter_preference or 'sided'
@property
def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + [
'sidebar_type',
]
@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + [
'sidebar_type',
]
#----------------------------------------------------------
# Database
# Fields
#----------------------------------------------------------
sidebar_type = fields.Selection(
@ -49,32 +31,7 @@ class ResUsers(models.Model):
('small', 'Small'),
('large', 'Large')
],
required=True,
string="Sidebar Type",
default=lambda self: self._default_sidebar_type()
)
chatter_position = fields.Selection(
selection=[
('normal', 'Normal'),
('sided', 'Sided'),
],
default='large',
required=True,
string="Chatter Position",
default=lambda self: self._default_chatter_position()
)
#----------------------------------------------------------
# Setup
#----------------------------------------------------------
def __init__(self, pool, cr):
init_res = super(ResUsers, self).__init__(pool, cr)
theme_fields = ['sidebar_type', 'chatter_position']
readable_fields = list(self.SELF_READABLE_FIELDS)
writeable_fields = list(self.SELF_WRITEABLE_FIELDS)
readable_fields.extend(theme_fields)
writeable_fields.extend(theme_fields)
type(self).SELF_READABLE_FIELDS = readable_fields
type(self).SELF_WRITEABLE_FIELDS = writeable_fields
return init_res

57
muk_web_theme/models/web_editor_assets.py

@ -1,25 +1,3 @@
###################################################################################
#
# Copyright (c) 2017-today MuK IT GmbH.
#
# This file is part of MuK Theme
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
import re
import uuid
import base64
@ -36,15 +14,15 @@ class ScssEditor(models.AbstractModel):
# Helper
# ----------------------------------------------------------
def _get_variable(self, content, variable):
def _get_theme_variable(self, content, variable):
regex = r'{0}\:?\s(.*?);'.format(variable)
value = re.search(regex, content)
return value and value.group(1)
def _get_variables(self, content, variables):
return {var: self._get_variable(content, var) for var in variables}
def _get_theme_variables(self, content, variables):
return {var: self._get_theme_variable(content, var) for var in variables}
def _replace_variables(self, content, variables):
def _replace_theme_variables(self, content, variables):
for variable in variables:
variable_content = '{0}: {1};'.format(
variable['name'],
@ -53,19 +31,28 @@ class ScssEditor(models.AbstractModel):
regex = r'{0}\:?\s(.*?);'.format(variable['name'])
content = re.sub(regex, variable_content, content)
return content
@api.model
def _save_asset_hook(self):
res = super()._save_asset_hook()
if self.env.context.get('theme_variables', False):
res['website_id'] = False
return res
# ----------------------------------------------------------
# Functions
# ----------------------------------------------------------
def get_variables_values(self, url, bundle, variables):
custom_url = self.make_custom_asset_file_url(url, bundle)
content = self.get_asset_content(custom_url)
def get_theme_variables_values(self, url, bundle, variables):
custom_url = self._make_custom_asset_url(url, bundle)
content = self._get_content_from_url(custom_url)
if not content:
content = self.get_asset_content(url)
return self._get_variables(content.decode('utf-8'), variables)
content = self._get_content_from_url(url)
return self._get_theme_variables(content.decode('utf-8'), variables)
def replace_variables_values(self, url, bundle, variables):
original = self.get_asset_content(url).decode('utf-8')
content = self._replace_variables(original, variables)
self.save_asset(url, bundle, content, 'scss')
def replace_theme_variables_values(self, url, bundle, variables):
original = self._get_content_from_url(url).decode('utf-8')
content = self._replace_theme_variables(original, variables)
self.with_context(theme_variables=True).save_asset(
url, bundle, content, 'scss'
)

BIN
muk_web_theme/static/description/branding_mail_banner.png

Before

Width: 880  |  Height: 440  |  Size: 43 KiB

BIN
muk_web_theme/static/description/branding_saas_banner.png

Before

Width: 880  |  Height: 440  |  Size: 43 KiB

BIN
muk_web_theme/static/description/branding_website_banner.png

Before

Width: 880  |  Height: 440  |  Size: 43 KiB

21
muk_web_theme/static/description/index.html

@ -4,6 +4,13 @@
<h3 class="oe_slogan">Odoo Community Backend Theme</h3>
<img src="logo.png" style="width: 150px;" class="mx-auto center-block">
<h4 class="oe_slogan mt-0" style="font-size: 23px">MuK IT GmbH - www.mukit.at</h4>
<div class="mb-4" style="text-align: center;">
<span class="btn btn-sm mb-2" style="font-size:14px; font-weight:500; background-color:#243742; color:#fff; cursor:default;"><i class="fa fa-check"></i> Community</span>
<span class="btn btn-sm mb-2" style="font-size:14px; font-weight:500; background-color:#243742; color:#fff; cursor:default;"><i class="fa fa-times mr-1"></i> Enterprise</span>
<span class="btn btn-sm mb-2" style="font-size:14px; font-weight:500; background-color:#243742; color:#fff; cursor:default;"><i class="fa fa-check"></i> onPremise</span>
<span class="btn btn-sm mb-2" style="font-size:14px; font-weight:500; background-color:#243742; color:#fff; cursor:default;"><i class="fa fa-times mr-1"></i> Odoo.sh</span>
<span class="btn btn-sm mb-2" style="font-size:14px; font-weight:500; background-color:#243742; color:#fff; cursor:default;"><i class="fa fa-times mr-1"></i>Odoo Online</span>
</div>
<div class="oe_demo oe_screenshot"
style="max-width: 84%; margin: 16px 8%">
<img src="screenshot.png">
@ -128,10 +135,10 @@
<div>
<div>
<div style="width: 75px; height: 75px; border-radius: 100%; margin: auto">
<img src="/service_implementation.png" style="width: 100%; border-radius: 100%">
<img src="/service_development.png" style="width: 100%; border-radius: 100%">
</div>
<h3 class="oe_slogan" style="text-align: center; font-size: 14px; width: 100%; margin: 0; margin-top: 5px; color: #000 !important; opacity: 1 !important; line-height: 17px">
Odoo <br>Implementation
Odoo <br>Development
</h3>
</div>
</div>
@ -148,20 +155,20 @@
<div>
<div>
<div style="width: 75px; height: 75px; border-radius: 100%; margin: auto">
<img src="/service_customization.png" style="width: 100%; border-radius: 100%">
<img src="/service_infrastructure.png" style="width: 100%; border-radius: 100%">
</div>
<h3 class="oe_slogan" style="text-align: center; font-size: 14px; width: 100%; margin: 0; margin-top: 5px; color: #000 !important; opacity: 1 !important; line-height: 17px">
Odoo <br>Customization
Odoo <br>Infrastructure
</h3>
</div>
</div>
<div>
<div>
<div style="width: 75px; height: 75px; border-radius: 100%; margin: auto">
<img src="/service_development.png" style="width: 100%; border-radius: 100%">
<img src="/service_training.png" style="width: 100%; border-radius: 100%">
</div>
<h3 class="oe_slogan" style="text-align: center; font-size: 14px; width: 100%; margin: 0; margin-top: 5px; color: #000 !important; opacity: 1 !important; line-height: 17px">
Odoo <br>Development
Odoo <br>Training
</h3>
</div>
</div>
@ -177,4 +184,4 @@
</div>
</div>
</div>
</section>
</section>

BIN
muk_web_theme/static/description/screenshot.png

Before

Width: 3200  |  Height: 1800  |  Size: 2.1 MiB

After

Width: 3200  |  Height: 1800  |  Size: 2.2 MiB

BIN
muk_web_theme/static/description/screenshot_apps.png

Before

Width: 3200  |  Height: 1800  |  Size: 1.6 MiB

After

Width: 3200  |  Height: 1800  |  Size: 1.5 MiB

BIN
muk_web_theme/static/description/screenshot_chatter.png

Before

Width: 3200  |  Height: 1800  |  Size: 393 KiB

After

Width: 3200  |  Height: 1800  |  Size: 545 KiB

BIN
muk_web_theme/static/description/screenshot_customize.png

Before

Width: 1600  |  Height: 900  |  Size: 113 KiB

After

Width: 3200  |  Height: 1800  |  Size: 408 KiB

BIN
muk_web_theme/static/description/screenshot_mobile_apps.png

Before

Width: 1080  |  Height: 1920  |  Size: 960 KiB

After

Width: 750  |  Height: 1334  |  Size: 524 KiB

BIN
muk_web_theme/static/description/screenshot_mobile_form.png

Before

Width: 1080  |  Height: 1920  |  Size: 222 KiB

After

Width: 750  |  Height: 1334  |  Size: 98 KiB

BIN
muk_web_theme/static/description/screenshot_mobile_kanban.png

Before

Width: 1080  |  Height: 1920  |  Size: 202 KiB

After

Width: 750  |  Height: 1334  |  Size: 77 KiB

BIN
muk_web_theme/static/description/screenshot_mobile_menu.png

Before

Width: 1080  |  Height: 1920  |  Size: 555 KiB

After

Width: 750  |  Height: 1334  |  Size: 75 KiB

BIN
muk_web_theme/static/description/screenshot_settings.png

Before

Width: 1600  |  Height: 900  |  Size: 99 KiB

After

Width: 3200  |  Height: 1800  |  Size: 367 KiB

BIN
muk_web_theme/static/description/service_customization.png

Before

Width: 250  |  Height: 250  |  Size: 27 KiB

BIN
muk_web_theme/static/description/service_development.png

Before

Width: 250  |  Height: 250  |  Size: 28 KiB

After

Width: 250  |  Height: 250  |  Size: 26 KiB

BIN
muk_web_theme/static/description/service_implementation.png

Before

Width: 250  |  Height: 250  |  Size: 26 KiB

BIN
muk_web_theme/static/description/service_infrastructure.png

After

Width: 250  |  Height: 250  |  Size: 20 KiB

BIN
muk_web_theme/static/description/service_training.png

After

Width: 250  |  Height: 250  |  Size: 24 KiB

28
muk_web_theme/static/src/colors.scss

@ -1,35 +1,9 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
$o-brand-odoo: #243742;
$o-brand-primary: #5D8DA8;
$mk-required-color: #d1dfe6;
$mk-apps-color: #f8f9fa;
$mk-menu-color: #f8f9fa;
$mk-appbar-color: #dee2e6;
$mk-appbar-background: #000000;
$mk-brand-gradient-start: lighten($o-brand-odoo, 10%);
$mk-brand-gradient-end: lighten($o-brand-odoo, 20%);

25
muk_web_theme/static/src/core/pager/pager.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<t
t-name="web_refresher.Pager"
t-inherit="web.Pager"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//span[hasclass('o_pager_counter')]" position="before">
<button
t-if="props.withAccessKey and !env.isSmall"
type="button"
class="fa fa-refresh btn btn-secondary rounded me-1"
aria-label="Refresh"
title="Refresh"
data-hotkey="r"
tabindex="-1"
t-on-click.stop="() => this.navigate(0)"
/>
</xpath>
</t>
</template>

64
muk_web_theme/static/src/legacy/js/fields_relational.js

@ -1,64 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.relational_fields', function (require) {
"use strict";
const config = require("web.config");
const fields = require('web.relational_fields');
fields.FieldStatus.include({
_setState() {
this._super(...arguments);
if (config.device.isMobile) {
_.map(this.status_information, (value) => {
value.fold = true;
});
}
},
});
fields.FieldOne2Many.include({
_renderButtons() {
const result = this._super(...arguments);
if (config.device.isMobile && this.$buttons) {
const $buttons = this.$buttons.find('.btn-secondary');
$buttons.addClass('btn-primary mk_mobile_add');
$buttons.removeClass('btn-secondary');
}
return result;
}
});
fields.FieldMany2Many.include({
_renderButtons() {
const result = this._super(...arguments);
if (config.device.isMobile && this.$buttons) {
const $buttons = this.$buttons.find('.btn-secondary');
$buttons.addClass('btn-primary mk_mobile_add');
$buttons.removeClass('btn-secondary');
}
return result;
}
});
});

49
muk_web_theme/static/src/legacy/js/form_renderer.js

@ -1,49 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.FormRenderer', function (require) {
"use strict";
const core = require('web.core');
const config = require("web.config");
const FormRenderer = require('web.FormRenderer');
FormRenderer.include({
_renderHeaderButtons() {
const $buttons = this._super(...arguments);
if (
!config.device.isMobile ||
!$buttons.is(":has(>:not(.o_invisible_modifier))")
) {
return $buttons;
}
$buttons.addClass("dropdown-menu");
const $dropdown = $(
core.qweb.render("muk_web_theme.MenuStatusbarButtons")
);
$buttons.addClass("dropdown-menu").appendTo($dropdown);
return $dropdown;
},
});
});

49
muk_web_theme/static/src/legacy/js/form_view.js

@ -1,49 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.FormView', function (require) {
"use strict";
const config = require("web.config");
const FormView = require('web.FormView');
const QuickCreateFormView = require('web.QuickCreateFormView');
FormView.include({
init() {
this._super(...arguments);
if (config.device.isMobile) {
this.controllerParams.disableAutofocus = true;
}
},
});
QuickCreateFormView.include({
init() {
this._super(...arguments);
if (config.device.isMobile) {
this.controllerParams.disableAutofocus = true;
}
},
});
});

42
muk_web_theme/static/src/legacy/js/kanban_column.js

@ -1,42 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.KanbanColumn', function (require) {
"use strict";
const config = require('web.config');
const KanbanColumn = require('web.KanbanColumn');
if (!config.device.isMobile) {
return;
}
KanbanColumn.include({
init() {
this._super(...arguments);
this.recordsDraggable = false;
this.canBeFolded = false;
},
});
});

44
muk_web_theme/static/src/legacy/js/kanban_quick_create.js

@ -1,44 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.kanban_column_quick_create', function (require) {
"use strict";
const config = require('web.config');
const KanbanRenderer = require('web.kanban_column_quick_create');
KanbanRenderer.include({
init() {
this._super(...arguments);
this.isMobile = config.device.isMobile;
},
_cancel() {
if (!config.device.isMobile) {
this._super(...arguments);
} else if (!this.folded) {
this.$input.val('');
}
},
});
});

271
muk_web_theme/static/src/legacy/js/kanban_renderer.js

@ -1,271 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.KanbanRenderer', function (require) {
"use strict";
const config = require('web.config');
const core = require('web.core');
const KanbanRenderer = require('web.KanbanRenderer');
const _t = core._t;
const qweb = core.qweb;
if (!config.device.isMobile) {
return;
}
KanbanRenderer.include({
custom_events: _.extend({}, KanbanRenderer.prototype.custom_events || {}, {
quick_create_column_created: '_onColumnAdded',
}),
events: _.extend({}, KanbanRenderer.prototype.events, {
'click .o_kanban_mobile_tab': '_onMobileTabClicked',
'click .o_kanban_mobile_add_column': '_onMobileQuickCreateClicked',
}),
ANIMATE: true,
init() {
this._super.apply(this, arguments);
this.activeColumnIndex = 0;
this._scrollPosition = null;
},
on_attach_callback() {
if (this._scrollPosition && this.state.groupedBy.length && this.widgets.length) {
var $column = this.widgets[this.activeColumnIndex].$el;
$column.scrollLeft(this._scrollPosition.left);
$column.scrollTop(this._scrollPosition.top);
}
this._computeTabPosition();
this._super.apply(this, arguments);
},
on_detach_callback() {
if (this.state.groupedBy.length && this.widgets.length) {
var $column = this.widgets[this.activeColumnIndex].$el;
this._scrollPosition = {
left: $column.scrollLeft(),
top: $column.scrollTop(),
};
} else {
this._scrollPosition = null;
}
this._super.apply(this, arguments);
},
addQuickCreate() {
if(this._canCreateColumn() && !this.quickCreate.folded) {
this._onMobileQuickCreateClicked();
}
return this.widgets[this.activeColumnIndex].addQuickCreate();
},
updateColumn(localID) {
var index = _.findIndex(this.widgets, {db_id: localID});
var $column = this.widgets[index].$el;
var scrollTop = $column.scrollTop();
return this._super.apply(this, arguments)
.then(() => this._layoutUpdate(false))
.then(() => $column.scrollTop(scrollTop));
},
_canCreateColumn: function() {
return this.quickCreateEnabled && this.quickCreate && this.widgets.length;
},
_computeColumnPosition(animate) {
if (this.widgets.length) {
const rtl = _t.database.parameters.direction === 'rtl';
this.$('.o_kanban_group').show();
const $columnAfter = this._toNode(this.widgets.filter((widget, index) => index > this.activeColumnIndex));
const promiseAfter = this._updateColumnCss($columnAfter, rtl ? {right: '100%'} : {left: '100%'}, animate);
const $columnBefore = this._toNode(this.widgets.filter((widget, index) => index < this.activeColumnIndex));
const promiseBefore = this._updateColumnCss($columnBefore, rtl ? {right: '-100%'} : {left: '-100%'}, animate);
const $columnCurrent = this._toNode(this.widgets.filter((widget, index) => index === this.activeColumnIndex));
const promiseCurrent = this._updateColumnCss($columnCurrent, rtl ? {right: '0%'} : {left: '0%'}, animate);
promiseAfter
.then(promiseBefore)
.then(promiseCurrent)
.then(() => {
$columnAfter.hide();
$columnBefore.hide();
});
}
},
_computeCurrentColumn() {
if (this.widgets.length) {
var column = this.widgets[this.activeColumnIndex];
if (!column) {
return;
}
var columnID = column.id || column.db_id;
this.$('.o_kanban_mobile_tab.o_current, .o_kanban_group.o_current')
.removeClass('o_current');
this.$('.o_kanban_group[data-id="' + columnID + '"], ' +
'.o_kanban_mobile_tab[data-id="' + columnID + '"]')
.addClass('o_current');
}
},
_computeTabPosition() {
this._computeTabJustification();
this._computeTabScrollPosition();
},
_computeTabScrollPosition() {
if (this.widgets.length) {
var lastItemIndex = this.widgets.length - 1;
var moveToIndex = this.activeColumnIndex;
var scrollToLeft = 0;
for (var i = 0; i < moveToIndex; i++) {
var columnWidth = this._getTabWidth(this.widgets[i]);
if (moveToIndex !== lastItemIndex && i === moveToIndex - 1) {
var partialWidth = 0.75;
scrollToLeft += columnWidth * partialWidth;
} else {
scrollToLeft += columnWidth;
}
}
this.$('.o_kanban_mobile_tabs').scrollLeft(scrollToLeft);
}
},
_computeTabJustification() {
if (this.widgets.length) {
var self = this;
var widthChilds = this.widgets.reduce(function (total, column) {
return total + self._getTabWidth(column);
}, 0);
var $tabs = this.$('.o_kanban_mobile_tabs');
$tabs.toggleClass('justify-content-between', $tabs.outerWidth() >= widthChilds);
}
},
_enableSwipe() {
var self = this;
var step = _t.database.parameters.direction === 'rtl' ? -1 : 1;
this.$el.swipe({
excludedElements: ".o_kanban_mobile_tabs",
swipeLeft() {
var moveToIndex = self.activeColumnIndex + step;
if (moveToIndex < self.widgets.length) {
self._moveToGroup(moveToIndex, self.ANIMATE);
}
},
swipeRight() {
var moveToIndex = self.activeColumnIndex - step;
if (moveToIndex > -1) {
self._moveToGroup(moveToIndex, self.ANIMATE);
}
}
});
},
_getTabWidth (column) {
var columnID = column.id || column.db_id;
return this.$('.o_kanban_mobile_tab[data-id="' + columnID + '"]').outerWidth();
},
_layoutUpdate (animate) {
this._computeCurrentColumn();
this._computeTabPosition();
this._computeColumnPosition(animate);
},
_moveToGroup(moveToIndex, animate) {
if (moveToIndex < 0 || moveToIndex >= this.widgets.length) {
this._layoutUpdate(animate);
return Promise.resolve();
}
this.activeColumnIndex = moveToIndex;
var column = this.widgets[this.activeColumnIndex];
if (column.data.isOpen) {
this._layoutUpdate(animate);
} else {
this.trigger_up('column_toggle_fold', {
db_id: column.db_id,
onSuccess: () => this._layoutUpdate(animate)
});
}
this._enableSwipe();
return Promise.resolve();
},
_renderGrouped(fragment) {
var self = this;
var newFragment = document.createDocumentFragment();
this._super.apply(this, [newFragment]);
this.defs.push(Promise.all(this.defs).then(function () {
var data = [];
_.each(self.state.data, function (group) {
if (!group.value) {
group = _.extend({}, group, {value: _t('Undefined')});
data.unshift(group);
} else {
data.push(group);
}
});
var kanbanColumnContainer = document.createElement('div');
kanbanColumnContainer.classList.add('o_kanban_columns_content');
kanbanColumnContainer.appendChild(newFragment);
fragment.appendChild(kanbanColumnContainer);
$(qweb.render('KanbanView.MobileTabs', {
data: data,
quickCreateEnabled: self._canCreateColumn()
})).prependTo(fragment);
}));
},
_renderView() {
var self = this;
return this._super.apply(this, arguments).then(function () {
if (self.state.groupedBy.length) {
return self._moveToGroup(0);
} else {
if(self._canCreateColumn()) {
self._onMobileQuickCreateClicked();
}
return Promise.resolve();
}
});
},
_toNode(widgets) {
const selectorCss = widgets
.map(widget => '.o_kanban_group[data-id="' + (widget.id || widget.db_id) + '"]')
.join(', ');
return this.$(selectorCss);
},
_updateColumnCss($column, cssProperties, animate) {
if (animate) {
return new Promise(resolve => $column.animate(cssProperties, 'fast', resolve));
} else {
$column.css(cssProperties);
return Promise.resolve();
}
},
_onColumnAdded() {
this._computeTabPosition();
if(this._canCreateColumn() && !this.quickCreate.folded) {
this.quickCreate.toggleFold();
}
},
_onMobileQuickCreateClicked: function() {
this.$('.o_kanban_group').toggle();
this.quickCreate.toggleFold();
},
_onMobileTabClicked(event) {
if(this._canCreateColumn() && !this.quickCreate.folded) {
this.quickCreate.toggleFold();
}
this._moveToGroup($(event.currentTarget).index(), true);
},
_renderExampleBackground() {},
});
});

37
muk_web_theme/static/src/legacy/js/kanban_view.js

@ -1,37 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_theme.KanbanView', function (require) {
"use strict";
const config = require("web.config");
const KanbanView = require('web.KanbanView');
KanbanView.include({
init() {
this._super.apply(this, arguments);
this.jsLibs.push("/web/static/lib/jquery.touchSwipe/jquery.touchSwipe.js");
},
});
});

50
muk_web_theme/static/src/legacy/scss/calendar_view.scss

@ -1,50 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@include media-breakpoint-down(sm) {
.o_calendar_view .o_calendar_widget {
.fc-timeGridDay-view .fc-axis,
.fc-timeGridWeek-view .fc-axis {
padding-left: 0px;
}
.fc-dayGridMonth-view {
padding-left: 0px;
.fc-week-number {
display: none;
}
}
.fc-dayGridYear-view {
padding-left: 0px;
> .fc-month-container {
width: 95%;
}
}
.fc-timeGridDay-view .fc-widget-header {
margin: 0 4px;
}
.fc-timeGridWeek-view .fc-widget-header {
word-spacing: 4em;
white-space: normal;
text-align: center;
}
}
}

40
muk_web_theme/static/src/legacy/scss/fields.scss

@ -1,40 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
.o_field_widget {
&.o_field_many2one .o_external_button {
color: $o-brand-odoo
}
}
.o_required_modifier {
&.o_input, .o_input {
background-color: $mk-required-color !important;
}
}
@include media-breakpoint-down(sm) {
.o_form_view .mk_mobile_add {
margin-left: 0 !important;
margin-bottom: 10px !important;
}
}

158
muk_web_theme/static/src/legacy/scss/form_view.scss

@ -1,158 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
.o_form_view {
.o_form_sheet_bg {
background: $o-webclient-background-color;
border-bottom: 1px solid gray('300');
> .o_form_sheet {
@include mk-container-widths();
background-color: $o-view-background-color;
border: 1px solid gray('400');
box-shadow: 0 5px 20px -15px black;
max-width: calc(100% - #{$o-horizontal-padding*2});
}
.o_form_statusbar {
position: sticky;
z-index: 1;
top: 0;
}
.oe_button_box {
.btn.oe_stat_button > .o_button_icon {
color: $o-brand-odoo;
}
}
.oe_title {
max-width: 100%;
width: initial;
span.o_field_widget {
max-width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: initial;
}
}
.o_notebook {
.nav-tabs {
overflow-x : auto;
overflow-y: hidden;
flex-flow: nowrap;
.nav-item {
white-space: nowrap;
}
}
> .tab-content > .tab-pane > :first-child {
margin-top: 0;
}
}
}
&.o_form_editable {
.oe_title {
max-width: map-get($container-max-widths, md) - (2 * $o-horizontal-padding);
}
}
@include media-breakpoint-down(sm) {
.o_form_sheet {
min-width: 100% !important;
max-width: 100% !important;
margin-top: 15px !important;
}
.o_group {
@for $i from 1 through $o-form-group-cols {
.o_group_col_#{$i} {
width: 100% !important;
}
}
.o_field_widget.o_text_overflow {
width: auto !important;
}
}
.o_statusbar_buttons_dropdown {
border: {
bottom: 0;
radius: 0;
top: 0;
}
height: 100%;
}
.o_statusbar_buttons > .btn {
border-radius: 0;
border: 0;
width: 100%;
margin-bottom: 0.2rem;
&:last-child {
margin-bottom: 0;
}
}
.o_statusbar_status {
.o_arrow_button:first-child::before {
content: none;
display: none;
}
}
.app_settings_block {
.row {
margin: 0;
}
}
.o_notebook .nav-tabs {
&::-webkit-scrollbar {
display: none;
}
}
.o_cp_buttons {
width: 100%;
div, .o-kanban-button-new {
width: 100%;
}
}
}
@include media-breakpoint-down(xs) {
.oe_title {
width: 100% !important;
max-width: 100% !important;
}
}
}
.mk_chatter_position_sided {
@include media-breakpoint-up(xxl, $o-extra-grid-breakpoints) {
.o_form_view:not(.o_form_nosheet) {
display: flex;
flex-flow: row nowrap;
height: 100%;
.o_form_sheet_bg {
min-width: $mk-form-min-width;
flex: 1 1 auto;
overflow: auto;
}
> .o_FormRenderer_chatterContainer {
flex: 1 1 auto;
overflow: auto;
min-width: $mk-chatter-min-width;
max-width: $mk-chatter-max-width;
border-left: 1px solid gray('400');
}
}
}
}

100
muk_web_theme/static/src/legacy/scss/kanban_view.scss

@ -1,100 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@include media-breakpoint-down(sm) {
.o_kanban_view.o_kanban_grouped {
display: block;
position: relative;
overflow-x: hidden;
.o_kanban_mobile_tabs_container {
position: sticky;
display: flex;
justify-content: space-between;
width: 100%;
top: 0;
z-index: 1;
background-color: #5E5E5E;
.o_kanban_mobile_add_column {
height: $o-kanban-mobile-tabs-height;
padding: 10px;
border-left: grey 1px solid;
color: white;
font-size: 14px;
}
.o_kanban_mobile_tabs {
position: relative;
display: flex;
width: 100%;
height: $o-kanban-mobile-tabs-height;
overflow-x: auto;
.o_kanban_mobile_tab {
height: $o-kanban-mobile-tabs-height;
padding: 10px 20px;
font-size: 14px;
color: white;
&.o_current {
font-weight: bold;
border-bottom: 3px solid $o-brand-primary;
}
.o_column_title {
white-space: nowrap;
text-transform: uppercase;
}
}
}
}
.o_kanban_columns_content {
position: relative;
}
&[class] .o_kanban_group:not(.o_column_folded) {
@include o-position-absolute($top: $o-kanban-mobile-tabs-height, $left: 0, $bottom: 0);
width: 100%;
padding: 0;
margin-left: 0;
border: none;
&.o_current {
position: inherit;
top: 0;
&.o_kanban_no_records {
min-height: $o-kanban-mobile-empty-height;
}
}
.o_kanban_header {
display: none;
}
.o_kanban_record, .o_kanban_quick_create {
border: none;
border-bottom: 1px solid lightgray;
padding: 10px 16px;
margin: 0;
}
}
}
.o_kanban_view .o_column_quick_create {
.o_quick_create_folded {
display: none !important;
}
.o_quick_create_unfolded{
width: 100%;
}
}
}

75
muk_web_theme/static/src/legacy/scss/list_view.scss

@ -1,75 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
.o_list_view {
table {
overflow-x: hidden;
}
table, thead, tfoot, td, th {
border: none !important;
}
thead {
background-color: white;
th.o_column_sortable:hover {
background-color: white;
}
}
tfoot {
color: white !important;
cursor: default;
font-weight: normal;
}
}
.o_list_table_grouped.table tbody tr {
&:nth-of-type(2n+1) {
background-color: white;
}
&.o_group_header {
background-image: none;
background-color: gray('200');
box-shadow: inset 0 1px 0 gray('300');
}
&:hover {
background-color: gray('200');
}
}
.o_content, .modal-content {
> div > .table-responsive {
overflow-x: initial;
> .o_list_view {
thead, thead tr:nth-child(1) th {
border-bottom: solid 1px gray('300');
background-color: white;
position: sticky;
z-index: 1;
top: 0;
}
tfoot, tfoot tr:nth-child(1) td {
background-color: $o-list-footer-bg-color;
position: sticky;
bottom: 0;
}
}
}
}

38
muk_web_theme/static/src/legacy/scss/settings_view.scss

@ -1,38 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@include media-breakpoint-down(sm) {
.o_base_settings .o_setting_container {
display: block;
.settings_tab {
flex-flow: row nowrap;
padding-top: 0px;
.tab {
padding-right: 16px;
}
.selected {
background-color: #212529;
box-shadow: inset 0 -5px #7c7bad;
}
}
}
}

108
muk_web_theme/static/src/legacy/xml/views.xml

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<templates id="template" xml:space="preserve">
<t t-name="muk_web_theme.MenuStatusbarButtons">
<div class="dropdown">
<button class="o_statusbar_buttons_dropdown btn btn-secondary dropdown-toggle" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions
</button>
</div>
</t>
<t t-name="muk_web_theme.IconButton">
<i t-attf-class="d-inline d-sm-none fa fa-#{icon}" t-att-title="label"/>
<span class="d-none d-sm-inline" t-esc="label"/>
</t>
<t t-extend="FormView.buttons">
<t t-jquery=".o_form_button_edit" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'pencil'"/>
<t t-set="label">Edit</t>
</t>
</t>
<t t-jquery=".o_form_button_create" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'plus'"/>
<t t-set="label">Create</t>
</t>
</t>
<t t-jquery=".o_form_button_save" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'floppy-o'"/>
<t t-set="label">Save</t>
</t>
</t>
<t t-jquery=".o_form_button_cancel" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'times'"/>
<t t-set="label">Discard</t>
</t>
</t>
</t>
<t t-extend="ListView.buttons">
<t t-jquery=".o_list_button_add" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'plus'"/>
<t t-set="label">Create</t>
</t>
</t>
<t t-jquery=".o_list_button_save" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'floppy-o'"/>
<t t-set="label">Save</t>
</t>
</t>
<t t-jquery=".o_list_button_discard" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'times'"/>
<t t-set="label">Discard</t>
</t>
</t>
</t>
<t t-extend="KanbanView.buttons">
<t t-jquery="button" t-operation="inner">
<t t-call="muk_web_theme.IconButton">
<t t-set="icon" t-value="'plus'"/>
<t t-set="label" t-value="create_text || _t('Create')"/>
</t>
</t>
</t>
<t t-extend="SearchView.FavoriteMenu">
<t t-jquery="button[data-toggle='dropdown']" t-operation="inner">
<span class="fa fa-star"/>
<span class="mk_dropdown_text">Favorites</span>
<span t-if="widget.isMobile" class="fa fa-chevron-right float-right mt4"/>
</t>
</t>
</templates>

30
muk_web_theme/static/src/mixins.scss

@ -1,25 +1,3 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@mixin mk-disable-scrollbar {
scrollbar-width: none;
-ms-overflow-style: none;
@ -45,11 +23,3 @@
box-shadow: none;
border: none;
}
@mixin mk-container-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
@each $breakpoint, $container-max-width in $max-widths {
@include media-breakpoint-up($breakpoint, $breakpoints) {
width: $container-max-width;
}
}
}

64
muk_web_theme/static/src/search/control_panel/control_panel.js

@ -1,64 +0,0 @@
/** @odoo-module **/
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
import { patch } from "web.utils";
import { useService } from "@web/core/utils/hooks";
import { SIZES } from "@web/core/ui/ui_service";
import LegacyControlPanel from "web.ControlPanel";
import { ControlPanel } from "@web/search/control_panel/control_panel";
import { SearchBar } from "@web/search/search_bar/search_bar";
const {useState, useContext} = owl.hooks;
patch(LegacyControlPanel.prototype, "muk_web_theme.LegacyControlPanelMobile", {
setup() {
this._super();
this.state = useState({
mobileSearchMode: "",
});
},
setMobileSearchMode(ev) {
this.state.mobileSearchMode = ev.detail;
},
});
patch(ControlPanel.prototype, "muk_web_theme.ControlPanelMobile", {
setup() {
this._super();
this.state = useState({
mobileSearchMode: "",
});
this.SIZES = SIZES;
this.uiService = useService("ui");
console.log(this);
},
setMobileSearchMode(ev) {
this.state.mobileSearchMode = ev.detail;
},
});
patch(SearchBar, "muk_web_theme.SearchBarMobile", {
template: "muk_web_theme.SearchBar",
});

243
muk_web_theme/static/src/search/control_panel/control_panel.scss

@ -1,243 +0,0 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@include media-breakpoint-down(sm) {
.o_control_panel {
padding-left: $o-horizontal-padding /2;
padding-right: $o-horizontal-padding /2;
.o_cp_top {
justify-content: space-between;
.o_cp_top_left {
flex-grow: 100;
.breadcrumb {
overflow: hidden;
display: block;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.o_cp_top_right {
flex-grow: 1;
min-height: 35px;
.o_searchview_mobile {
border: none;
}
}
}
.o_cp_bottom {
justify-content: space-between;
.o_cp_bottom_left {
flex-grow: 1;
.o_cp_action_menus, .o_cp_buttons {
flex: 1 1 100%;
}
.o_cp_action_menus .o_dropdown .o_dropdown_toggler_btn {
.o_dropdown_title {
display: none;
}
i:last-of-type{
display: none;
}
&::after{
display: inline-block;
width: 0;
height: 0;
margin-left: 0.255em;
vertical-align: 0.255em;
content: "";
border-top: 0.3em solid;
border-right: 0.3em solid transparent;
border-bottom: 0;
border-left: 0.3em solid transparent;
}
}
}
.o_cp_bottom_right {
.o_cp_pager {
white-space: nowrap;
.o_pager_counter {
max-width: 60px;
@include o-text-overflow;
}
.o_pager_previous, .o_pager_next {
border: none;
}
}
.o_search_options {
display: none;
}
}
}
.breadcrumb-item {
&:not(.active) {
padding-left: 0;
}
&::before {
content: none;
padding-right: 0;
}
&:nth-last-of-type(1n+3) {
display: none;
}
&:nth-last-of-type(2) {
&::before {
content: "\f053";
cursor: pointer;
color: $o-brand-primary;
font-family: FontAwesome;
}
a {
display: none;
}
}
}
.o_searchview_input_container > .o_searchview_autocomplete {
left: 0;
right: 0;
> li {
padding: 10px 0px;
}
}
.o_searchview_quick {
display: flex;
flex: 1 1 auto;
align-items: center;
.o_searchview_input_container {
flex: 1 1 auto;
}
}
.o_searchview {
padding: 1px 0px 3px 0px;
&.o_searchview_mobile {
cursor: pointer;
}
}
.o_cp_buttons .btn.d-block:not(.d-none) {
display: inline-block !important;
}
.o_cp_switch_buttons {
display: flex;
min-width: 0px;
flex-direction: row;
align-content: center;
justify-content: space-around;
padding: 0;
.btn {
margin: 5px;
border: none;
font-size: 1.25rem;
}
}
}
.o_controller_with_searchpanel .o_search_panel {
display: none;
}
}
.mk_cp_mobile_search {
position: fixed;
top: 0;
left: 0;
bottom: 0;
padding: 0;
width: 100%;
background-color: white;
z-index: $zindex-modal;
overflow: auto;
.mk_mobile_search_header {
height: 46px;
margin-bottom: 10px;
width: 100%;
background-color: $o-brand-odoo;
color: white;
span:active {
background-color: darken($o-brand-primary, 10%);
}
span {
cursor: pointer;
}
}
.o_searchview_input_container {
display: flex;
padding: 15px 20px 0 20px;
position: relative;
.o_searchview_input {
width: 100%;
margin-bottom: 15px;
border-bottom: 1px solid $o-brand-primary;
}
.o_searchview_facet {
display: inline-flex;
order: 1;
}
.o_searchview_autocomplete {
top: 3rem;
}
}
.mk_mobile_search_filter {
padding-bottom: 15%;
> .dropdown {
flex-direction: column;
line-height: 2rem;
width: 100%;
margin: 15px 5px 0px 5px;
border: solid 1px darken(gray("200"), 20%);
}
.dropdown.show > .dropdown-toggle {
background-color: gray("200");
}
.dropdown-toggle {
width: 100%;
text-align: left;
&:after {
top: auto;
}
}
.dropdown-item:before {
top: auto;
}
.dropdown-item.focus {
background-color: white;
}
.dropdown-menu {
position: relative !important;
top: 0 !important;
left: 0 !important;
width: 100%;
max-height: 100%;
box-shadow: none;
border: none;
color: gray("600");
.divider {
margin: 0px;
}
> li > a {
padding: 10px 26px;
}
}
}
.mk_mobile_search_show_result {
padding: 10px;
font-size: 15px;
}
}

299
muk_web_theme/static/src/search/control_panel/control_panel.xml

@ -1,299 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<templates>
<t t-inherit="web.Legacy.ControlPanel" t-inherit-mode="extension" owl="1">
<xpath expr="//nav[hasclass('o_cp_switch_buttons')]" position="replace">
<t t-if="props.views.length gt 1">
<t t-if="model.config.env.device.size_class &lt;= model.config.env.device.SIZES.LG">
<Dropdown
position="'bottom-end'"
menuClass="'d-inline-flex o_cp_switch_buttons'"
togglerClass="'btn btn-link'"
>
<t t-set-slot="toggler">
<i
class="fa fa-lg o_switch_view"
t-attf-class="o_{{env.view.type}} {{env.view.icon}} {{ props.views.filter(view => view.type === env.view.type)[0].icon }} {{env.view.active ? 'active' : ''}}"
/>
</t>
<t t-foreach="props.views" t-as="view" t-key="view.type">
<t t-call="web.ViewSwitcherButton" />
</t>
</Dropdown>
</t>
<t t-else="">
<nav
class="btn-group o_cp_switch_buttons"
role="toolbar"
aria-label="View switcher"
>
<t t-foreach="props.views" t-as="view" t-key="view.type">
<t t-call="web.ViewSwitcherButton" />
</t>
</nav>
</t>
</t>
</xpath>
<xpath expr="//div[hasclass('o_searchview')]" position="replace">
<div
t-if="props.withSearchBar"
class="o_searchview"
t-att-class="state.mobileSearchMode == 'quick' ? 'o_searchview_quick' : 'o_searchview_mobile'"
role="search"
aria-autocomplete="list"
t-on-click.self="state.mobileSearchMode = model.config.env.device.isMobile ? 'quick' : ''"
>
<t t-if="!model.config.env.device.isMobile">
<i
class="o_searchview_icon fa fa-search"
title="Search..."
role="img"
aria-label="Search..."
/>
<SearchBar fields="fields" />
</t>
<t t-if="model.config.env.device.isMobile and state.mobileSearchMode == 'quick'">
<button
class="btn btn-link fa fa-arrow-left"
t-on-click.stop="state.mobileSearchMode = ''"
/>
<SearchBar fields="fields" />
<button
class="btn fa fa-filter"
t-on-click.stop="state.mobileSearchMode = 'full'"
/>
</t>
<t t-if="model.config.env.device.isMobile and state.mobileSearchMode == 'full'">
<div class="mk_cp_mobile_search">
<div class="mk_mobile_search_header">
<span
class="o_mobile_search_close float-left mt16 mb16 mr8 ml16"
t-on-click.stop="state.mobileSearchMode = 'quick'"
>
<i class="fa fa-arrow-left" />
<strong class="float-right ml8">FILTER</strong>
</span>
<span
class="float-right o_mobile_search_clear_facets mt16 mr16"
t-on-click.stop="model.dispatch('clearQuery')"
>
<t>CLEAR</t>
</span>
</div>
<SearchBar fields="fields" />
<div class="mk_mobile_search_filter o_search_options mb8 mt8 ml16 mr16">
<FilterMenu
t-if="props.searchMenuTypes.includes('filter')"
class="o_filter_menu"
fields="fields"
/>
<GroupByMenu
t-if="props.searchMenuTypes.includes('groupBy')"
class="o_group_by_menu"
fields="fields"
/>
<ComparisonMenu
t-if="props.searchMenuTypes.includes('comparison') and model.get('filters', f => f.type === 'comparison').length"
class="o_comparison_menu"
/>
<FavoriteMenu
t-if="props.searchMenuTypes.includes('favorite')"
class="o_favorite_menu"
/>
</div>
<div
class="btn btn-primary mk_mobile_search_show_result fixed-bottom"
t-on-click.stop="state.mobileSearchMode = ''"
>
<t>SEE RESULT</t>
</div>
</div>
</t>
<t t-if="model.config.env.device.isMobile and state.mobileSearchMode == ''">
<button
class="btn btn-link fa fa-search"
t-on-click.stop="state.mobileSearchMode = 'quick'"
/>
</t>
</div>
</xpath>
<xpath expr="//div[hasclass('o_cp_top_left')]" position="attributes">
<attribute
name="t-att-class"
t-translation="off"
>model.config.env.device.isMobile and state.mobileSearchMode == 'quick' ? 'o_hidden' : ''</attribute>
</xpath>
</t>
<t t-inherit="web.ControlPanel" t-inherit-mode="extension" owl="1">
<xpath expr="//nav[hasclass('o_cp_switch_buttons')]" position="replace">
<t t-if="uiService.size &lt;= SIZES.LG">
<t
t-set="view"
t-value="env.config.viewSwitcherEntries.find((v) => v.active)"
/>
<Dropdown
position="'bottom-end'"
menuClass="'d-inline-flex o_cp_switch_buttons'"
togglerClass="'btn btn-link'"
>
<t t-set-slot="toggler">
<i
class="fa fa-lg o_switch_view"
t-attf-class="o_{{view.type}} {{view.icon}} active"
/>
</t>
<t
t-foreach="env.config.viewSwitcherEntries"
t-as="view"
t-key="view.type"
>
<button
class="btn btn-light fa o_switch_view"
t-attf-class="o_{{view.type}} {{view.icon}} {{view.active ? 'active' : ''}}"
t-att-data-tooltip="view.name"
t-on-click="onViewClicked(view.type)"
/>
</t>
</Dropdown>
</t>
<t t-else="">
<nav class="btn-group o_cp_switch_buttons">
<t
t-foreach="env.config.viewSwitcherEntries"
t-as="view"
t-key="view.type"
>
<button
class="btn btn-light fa fa-lg o_switch_view "
t-attf-class="o_{{view.type}} {{view.icon}} {{view.active ? 'active' : ''}}"
t-att-data-tooltip="view.name"
t-on-click="onViewClicked(view.type)"
/>
</t>
</nav>
</t>
</xpath>
<xpath expr="//SearchBar" position="replace">
<SearchBar
t-if="state.mobileSearchMode == 'quick'"
mobileSearchMode="state.mobileSearchMode"
searchMenus="searchMenus"
t-on-set-mobile-view.stop="setMobileSearchMode"
/>
<SearchBar
t-else=""
mobileSearchMode="state.mobileSearchMode"
searchMenus="searchMenus"
t-on-set-mobile-view.stop="setMobileSearchMode"
/>
</xpath>
<xpath expr="//div[hasclass('o_cp_top_left')]" position="attributes">
<attribute
name="t-att-class"
t-translation="off"
>env.isSmall and state.mobileSearchMode == 'quick' ? 'o_hidden' : ''</attribute>
</xpath>
</t>
<t t-name="muk_web_theme.SearchBar" owl="1">
<div>
<t t-if="!env.isSmall" t-call="web.SearchBar" />
<t t-if="env.isSmall and props.mobileSearchMode == 'quick'">
<div class="o_searchview o_searchview_quick">
<button
class="btn btn-link fa fa-arrow-left"
t-on-click.stop="trigger('set-mobile-view', '')"
/>
<div class="o_searchview_input_container">
<t t-call="web.SearchBar.Facets" />
<t t-call="web.SearchBar.Input" />
<t t-if="items.length">
<t t-call="web.SearchBar.Items" />
</t>
</div>
<button
class="btn fa fa-filter"
t-on-click.stop="trigger('set-mobile-view', 'full')"
/>
</div>
</t>
<t
t-if="env.isSmall and props.mobileSearchMode == 'full'"
t-call="muk_web_theme.MobileSearchView"
/>
<t t-if="env.isSmall and props.mobileSearchMode == ''">
<div
class="o_searchview o_searchview_mobile"
role="search"
aria-autocomplete="list"
t-on-click.stop="trigger('set-mobile-view', 'quick')"
>
<button class="btn btn-link fa fa-search" />
</div>
</t>
</div>
</t>
<t t-name="muk_web_theme.MobileSearchView" owl="1">
<div class="o_searchview">
<div class="mk_cp_mobile_search">
<div class="mk_mobile_search_header">
<span
class="o_mobile_search_close float-left mt16 mb16 mr8 ml16"
t-on-click.stop="trigger('set-mobile-view', 'quick')"
>
<i class="fa fa-arrow-left" />
<strong class="float-right ml8">FILTER</strong>
</span>
<span
class="float-right o_mobile_search_clear_facets mt16 mr16"
t-on-click.stop="env.searchModel.clearQuery()"
>
<t>CLEAR</t>
</span>
</div>
<div class="o_searchview_input_container">
<t t-call="web.SearchBar.Facets" />
<t t-call="web.SearchBar.Input" />
<t t-if="items.length">
<t t-call="web.SearchBar.Items" />
</t>
</div>
<div class="mk_mobile_search_filter o_search_options mb8 mt8 ml16 mr16">
<t t-foreach="props.searchMenus" t-as="menu" t-key="menu.key">
<t t-component="menu.Component" />
</t>
</div>
<div
class="btn btn-primary mk_mobile_search_show_result fixed-bottom"
t-on-click.stop="trigger('set-mobile-view', '')"
>
<t>SEE RESULT</t>
</div>
</div>
</div>
</t>
</templates>

22
muk_web_theme/static/src/variables.scss

@ -1,25 +1,3 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
//----------------------------------------------------------
// Helper
//----------------------------------------------------------

8
muk_web_theme/static/src/views/form/form.scss

@ -0,0 +1,8 @@
.o_form_view {
&:not(.o_field_highlight) .o_field_widget:not(.o_field_invalid) .o_input:not(:hover):not(:focus) {
border-color: $gray-200 !important;
}
.o_required_modifier.o_field_widget:not(.o_field_invalid) .o_input:not(:hover):not(:focus) {
border-color: $gray-600 !important;
}
}

12
muk_web_theme/static/src/views/list/list.scss

@ -0,0 +1,12 @@
.o_list_view .o_list_renderer {
overflow-x: initial;
thead, thead tr:nth-child(1) th {
position: sticky;
border: none;
z-index: 1;
top: 0;
}
tfoot, tfoot tr:nth-child(1) td {
color: $white;
}
}

26
muk_web_theme/static/src/webclient/appsbar/appsbar.js

@ -1,30 +1,6 @@
/** @odoo-module **/
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
import { useService } from "@web/core/utils/hooks";
const { Component, hooks } = owl;
import { Component } from "@odoo/owl";
export class AppsBar extends Component {}

22
muk_web_theme/static/src/webclient/appsbar/appsbar.scss

@ -1,25 +1,3 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
.mk_apps_sidebar_panel {
@include mk-disable-scrollbar();
overflow-y: auto;

34
muk_web_theme/static/src/webclient/appsbar/appsbar.xml

@ -1,27 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<templates xml:space="preserve">
<t t-name="muk_web_theme.AppsBar" owl="1">
@ -31,16 +9,18 @@
<t t-foreach="props.apps" t-as="app" t-key="app.id">
<li class="nav-item">
<a
t-attf-href="#menu_id={{ app.id }}&amp;action_id={{ app.actionID }}"
t-att-href="app.href"
t-att-data-menu-id="app.id"
t-att-data-menu-xmlid="app.xmlid"
t-att-data-action-id="app.actionID"
class="nav-link" role="menuitem"
t-on-click.prevent="() => app.action()"
class="nav-link"
role="menuitem"
>
<img
t-if="app.webIconData"
class="mk_apps_sidebar_icon"
t-attf-src="data:image/png;base64,{{ app.webIconData }}"
t-att-src="app.webIconData"
/>
<img
t-else=""
@ -48,7 +28,7 @@
src="/muk_web_theme/static/img/default_icon.png"
/>
<span class="mk_apps_sidebar_name">
<t t-esc="app.name"/>
<t t-out="app.name"/>
</span>
</a>
</li>
@ -57,5 +37,5 @@
</div>
</div>
</t>
</templates>

27
muk_web_theme/static/src/webclient/appsmenu/appsmenu.js

@ -1,38 +1,13 @@
/** @odoo-module **/
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
import { session } from "@web/session";
import { url } from "@web/core/utils/urls";
import { useService } from "@web/core/utils/hooks";
import { Dropdown } from "@web/core/dropdown/dropdown";
const { Component, hooks } = owl;
export class AppsMenu extends Dropdown {
setup() {
super.setup();
if (session.theme_has_background_image) {
if (this.env.services.company.currentCompany.has_background_image) {
this.backgroundImageUrl = url('/web/image', {
model: 'res.company',
field: 'background_image',

26
muk_web_theme/static/src/webclient/appsmenu/appsmenu.scss

@ -1,25 +1,3 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
.o_navbar_apps_menu .dropdown-toggle {
padding: 0px 14px !important;
}
@ -60,7 +38,7 @@
flex-basis: 0;
}
.mk_app_name {
color: $mk-apps-color;
color: $mk-menu-color;
}
}
&.focus, &.active, &:hover, &:focus, &:active {
@ -74,4 +52,4 @@
}
}
}
}
}

29
muk_web_theme/static/src/webclient/appsmenu/appsmenu.xml

@ -1,30 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<templates xml:space="preserve">
<t t-name="muk_web_theme.AppsMenu" t-inherit="web.Dropdown" t-inherit-mode="primary" owl="1">
<t
t-name="muk_web_theme.AppsMenu"
t-inherit="web.Dropdown"
t-inherit-mode="primary"
owl="1"
>
<xpath expr="//div[@t-ref='menuRef']" position="attributes">
<attribute name="t-attf-style">
background-image: url("{{ backgroundImageUrl }}");

97
muk_web_theme/static/src/webclient/appssearch/appssearch.js

@ -0,0 +1,97 @@
/** @odoo-module **/
import { Component, useState, useExternalListener } from "@odoo/owl";
import { computeAppsAndMenuItems } from "@web/webclient/menus/menu_helpers";
import { useAutofocus, useService } from '@web/core/utils/hooks';
import { useHotkey } from '@web/core/hotkeys/hotkey_hook';
import { fuzzyLookup } from '@web/core/utils/search';
import { debounce } from '@web/core/utils/timing';
export class AppsSearch extends Component {
setup() {
super.setup();
this.searchInput = useAutofocus();
this.state = useState({
hasResults: false,
results: [],
});
this.menuService = useService('menu');
Object.assign(this, computeAppsAndMenuItems(
this.menuService.getMenuAsTree('root')
));
this._onInput = debounce(this._onInput, 100);
}
_onInput() {
const query = this.searchInput.el.value;
if (query !== '') {
const results = [];
fuzzyLookup(
query, this.apps, (menu) => {
return menu.label
}
).forEach((menu) => {
const result = {
id: menu.id,
name: menu.label,
xmlid: menu.xmlid,
appID: menu.appID,
actionID: menu.actionID,
action: () => this.menuService.selectMenu(menu),
href: menu.href || `#menu_id=${menu.id}&amp;action_id=${menu.actionID}`,
};
if (menu.webIconData) {
const prefix = (
menu.webIconData.startsWith('P') ?
'data:image/svg+xml;base64,' :
'data:image/png;base64,'
);
result.webIconData = (
menu.webIconData.startsWith('data:image') ?
menu.webIconData :
prefix + menu.webIconData.replace(/\s/g, '')
);
result.style = `background-image:url("${result.webIconData}");`
}
results.push(result);
});
fuzzyLookup(
query, this.menuItems, (menu) => {
return `${menu.parents} / ${menu.label}`.split('/').reverse().join('/')
}
).forEach((menu) => {
results.push({
id: menu.id,
name: `${menu.parents} / ${menu.label}`,
xmlid: menu.xmlid,
appID: menu.appID,
actionID: menu.actionID,
action: () => this.menuService.selectMenu(menu),
href: menu.href || `#menu_id=${menu.id}&amp;action_id=${menu.actionID}`,
});
});
this.state.results = results;
this.state.hasResults = true;
} else {
this.state.results = [];
this.state.hasResults = false;
}
}
_onKeyDown(ev) {
if (ev.code === 'Escape') {
ev.stopPropagation();
ev.preventDefault();
if (this.searchInput.el.value) {
this.state.results = [];
this.state.hasResults = false;
this.searchInput.el.value = '';
} else {
this.env.bus.trigger('ACTION_MANAGER:UI-UPDATED');
}
}
}
}
Object.assign(AppsSearch, {
template: 'muk_web_theme.AppsSearch',
});

50
muk_web_theme/static/src/webclient/appssearch/appssearch.scss

@ -0,0 +1,50 @@
.mk_apps_search_container {
margin: 1rem 2.5rem;
width: 100%;
.mk_apps_search_input {
padding: 0.5rem 1.5rem;
box-shadow: inset 0 1px 0 rgba($white, 0.1), 0 1px 0 rgba($black, 0.1);
background-color: rgba($gray-100, 0.1);
border-radius: 4px;
.mk_apps_search_icon {
color: $mk-menu-color;
margin-right: 1rem;
font-size: 1.5rem;
}
input {
display: block;
height: 2.5rem;
border: none;
background: none;
color: $mk-menu-color;
box-shadow: none;
padding: 2px;
}
input::-webkit-search-cancel-button {
-webkit-appearance: none;
}
}
}
.mk_apps_search_menus {
height: calc(100% - #{$o-navbar-height});
margin-top: 1rem;
overflow: auto;
a {
color: $mk-menu-color;
display: block;
background-position: left;
background-repeat: no-repeat;
background-size: contain;
cursor: pointer;
line-height: 2.5rem;
padding-left: 3.5rem;
&:hover {
background-color: rgba($black, 0.1);
}
}
}
.mk_apps_search_active ~ .o_app {
display: none;
}

39
muk_web_theme/static/src/webclient/appssearch/appssearch.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-name="muk_web_theme.AppsSearch" owl="1">
<div
class="mk_apps_search_container"
t-att-class="state.hasResults ? 'mk_apps_search_active' : ''"
>
<div class="mk_apps_search_input d-flex align-items-center">
<span class="mk_apps_search_icon fa fa-search" />
<input
type="search"
autocomplete="off"
class="form-control"
placeholder="Search menus..."
data-allow-hotkeys="true"
t-on-input="_onInput"
t-on-keydown="_onKeyDown"
t-ref="autofocus"
/>
</div>
<div t-if="state.hasResults" class="mk_apps_search_menus">
<t t-foreach="state.results" t-as="menu" t-key="menu.id">
<a
t-att-style="menu.style ? menu.style : ''"
t-att-href="menu.href"
t-att-data-menu-id="menu.id"
t-att-data-menu-xmlid="menu.xmlid"
t-att-data-action-id="menu.actionID"
t-on-click.prevent="() => menu.action()"
t-out="menu.name"
/>
</t>
</div>
</div>
</t>
</templates>

89
muk_web_theme/static/src/webclient/navbar/navbar.js

@ -1,69 +1,46 @@
/** @odoo-module */
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
import { patch } from '@web/core/utils/patch';
import { session } from "@web/session";
import { url } from "@web/core/utils/urls";
import { patch } from "@web/core/utils/patch";
import { registry } from "@web/core/registry";
import { NavBar } from "@web/webclient/navbar/navbar";
import { NavBar } from '@web/webclient/navbar/navbar';
import { AppsMenu } from "@muk_web_theme/webclient/appsmenu/appsmenu";
import { AppsBar } from "@muk_web_theme/webclient/appsbar/appsbar";
import { SwitchCompanyMenu } from "@web/webclient/switch_company_menu/switch_company_menu";
import { UserMenu } from "@web/webclient/user_menu/user_menu";
patch(NavBar.prototype, "muk_web_theme.NavBar", {
setup() {
this._super();
this.backgroundBlendMode = session.theme_background_blend_mode;
import { AppsSearch } from "@muk_web_theme/webclient/appssearch/appssearch";
import { AppsBar } from '@muk_web_theme/webclient/appsbar/appsbar';
patch(NavBar.prototype, 'muk_web_theme.NavBar', {
getAppsMenuItems(apps) {
return apps.map((menu) => {
const appsMenuItem = {
id: menu.id,
name: menu.name,
xmlid: menu.xmlid,
appID: menu.appID,
actionID: menu.actionID,
href: this.getMenuItemHref(menu),
action: () => this.menuService.selectMenu(menu),
};
if (menu.webIconData) {
const prefix = (
menu.webIconData.startsWith('P') ?
'data:image/svg+xml;base64,' :
'data:image/png;base64,'
);
appsMenuItem.webIconData = (
menu.webIconData.startsWith('data:image') ?
menu.webIconData :
prefix + menu.webIconData.replace(/\s/g, '')
);
}
return appsMenuItem;
});
},
});
patch(NavBar, "muk_web_theme.NavBar", {
patch(NavBar, 'muk_web_theme.NavBar', {
components: {
...NavBar.components,
AppsMenu,
AppsSearch,
AppsBar,
},
});
const systrayItemUserMenu = {
Component: UserMenu,
};
const systrayItemSwitchCompanyMenu = {
Component: SwitchCompanyMenu,
isDisplayed(env) {
const { availableCompanies } = env.services.company;
return Object.keys(availableCompanies).length > 1;
},
};
registry.category("systray").add("web.user_menu", systrayItemUserMenu, {
force: true, sequence: 1
});
registry.category("systray").add("SwitchCompanyMenu", systrayItemSwitchCompanyMenu, {
force: true, sequence: 2
});

69
muk_web_theme/static/src/webclient/navbar/navbar.scss

@ -1,66 +1,3 @@
/**********************************************************************************
*
* Copyright (c) 2017-today MuK IT GmbH.
*
* This file is part of MuK Theme
* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
@include media-breakpoint-down(sm) {
.o_main_navbar {
grid-template-areas: "apps brand systray sections";
grid-template-columns: minmax($o-navbar-height, max-content) max-content auto minmax($o-navbar-height, max-content);
.o_menu_brand {
display: none;
}
.o_menu_sections {
width: $o-navbar-height;
}
.o_menu_sections_more {
.dropdown-toggle {
font-size: $font-size-lg;
}
.fa-plus:before {
content: "\f0c9";
}
}
.o_debug_manager, .o_user_menu, .o_switch_company_menu {
> .dropdown-toggle {
padding: 0 12px !important;
}
}
.o_menu_systray {
margin-left: auto;
}
.o_user_menu {
margin: 0;
}
.o_user_menu > .dropdown-toggle {
white-space: nowrap;
&::before, &::after {
content: normal;
}
.oe_topbar_name {
display: none;
}
}
.show .dropdown-menu {
@include mk-full-screen-menu();
font-size: $font-size-lg;
}
}
}
.o_menu_systray .badge {
--o-navbar-badge-bg: #{$o-brand-primary};
}

70
muk_web_theme/static/src/webclient/navbar/navbar.xml

@ -1,70 +1,60 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<templates xml:space="preserve">
<t t-name="muk_web_theme.NavBar" t-inherit="web.NavBar" t-inherit-mode="extension" owl="1">
<t
t-name="muk_web.theme.NavBar"
t-inherit="web.NavBar"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//nav" position="before">
<t t-set="apps" t-value="menuService.getApps()" />
<t t-set="apps" t-value="this.getAppsMenuItems(this.menuService.getApps())" />
</xpath>
<xpath expr="//t[@t-call='web.NavBar.AppsMenu']" position="replace">
<AppsMenu hotkey="'h'" title="'Home Menu'" class="o_navbar_apps_menu" manualOnly="true">
<AppsMenu
hotkey="'h'"
title="'Home Menu'"
class="'o_navbar_apps_menu'"
manualOnly="true"
>
<t t-set-slot="toggler">
<i class="fa fa-th" />
</t>
<MenuItem
t-foreach="apps"
t-as="app"
t-key="app.id"
class="o_app"
t-att-class="{ focus: menuService.getCurrentApp() === app }"
payload="app"
<AppsSearch t-if="!env.isSmall"/>
<DropdownItem
t-foreach="apps"
t-as="app"
t-key="app.id"
dataset="{ menuXmlid: app.xmlid, section: app.id }"
class="{ 'o_app': true, 'focus': menuService.getCurrentApp().id === app.id }"
onSelected="() => app.action()"
parentClosingMode="'none'"
>
<a t-att-href="getMenuItemHref(app)" t-on-click.prevent="">
<a
t-att-href="app.href"
t-on-click.prevent=""
>
<img
t-if="app.webIconData"
class="mk_app_icon"
t-attf-src="data:image/png;base64,{{ app.webIconData }}"
t-att-src="app.webIconData"
/>
<img
t-else=""
class="mk_app_icon"
src="/muk_web_theme/static/img/default_icon.png"
/>
<span class="mk_app_name" t-attf-style="mix-blend-mode: {{ backgroundBlendMode }};">
<t t-esc="app.name"/>
<span class="mk_app_name">
<t t-out="app.name"/>
</span>
</a>
</MenuItem>
</DropdownItem>
</AppsMenu>
</xpath>
<xpath expr="//nav" position="inside">
<AppsBar apps="apps"/>
</xpath>
<xpath expr="//t[@t-call='web.NavBar.SectionsMenu']" position="attributes">
<attribute name="t-if">currentAppSections.length</attribute>
</xpath>
</t>
</templates>

25
muk_web_theme/templates/webclient.xml

@ -1,27 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<template id="webclient_bootstrap" name="Web Client" inherit_id="web.webclient_bootstrap">
@ -33,8 +11,7 @@
</xpath>
<xpath expr="//t[@t-set='body_classname']" position="after">
<t t-set="body_sidebar_classname" t-value="'mk_sidebar_type_' + request.env.user.sidebar_type or 'small'"/>
<t t-set="body_chatter_classname" t-value="'mk_chatter_position_' + request.env.user.chatter_position or 'sided'"/>
<t t-set="body_classname" t-value="'%s %s %s' % (body_classname, body_sidebar_classname, body_chatter_classname)"/>
<t t-set="body_classname" t-value="'%s %s' % (body_classname, body_sidebar_classname)"/>
</xpath>
</template>

106
muk_web_theme/views/res_config_settings_view.xml → muk_web_theme/views/res_config_settings.xml

@ -1,27 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
@ -32,44 +10,7 @@
<div id="companies" position="after">
<h2 id="web_theme_title">Backend Theme</h2>
<div class="row mt16 o_settings_container" name="web_theme">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Default Preferences</span>
<div class="text-muted">
Set the default theme preferences
</div>
<div class="content-group">
<div class="mt16 row">
<label for="theme_default_sidebar_preference" string="Sidebar" class="col-3 o_light_label"/>
<field name="theme_default_sidebar_preference" class="col-5"/>
<div class="w-100"></div>
<label for="theme_default_chatter_preference" string="Chatter" class="col-3 o_light_label"/>
<field name="theme_default_chatter_preference" class="col-5"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Favicon</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Set the favicon for the system
</div>
<div class="content-group">
<div class="mt16 row">
<field name="theme_favicon" widget="image" class="ml-4 oe_avatar" required="1"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Theme Colors</span>
<div class="text-muted">
@ -78,20 +19,22 @@
<div class="content-group">
<div class="mt16 row">
<label for="theme_color_brand" string="Brand" class="col-3 o_light_label"/>
<field name="theme_color_brand" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<field name="theme_color_brand" class="d-block w-25 p-0 m-0" widget="color"/>
<div class="w-100 mt-1"></div>
<label for="theme_color_primary" string="Primary" class="col-3 o_light_label"/>
<field name="theme_color_primary" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="theme_color_required" string="Required" class="col-3 o_light_label"/>
<field name="theme_color_required" widget="color" class="oe_inline"/>
<field name="theme_color_primary" class="d-block w-25 p-0 m-0" widget="color"/>
</div>
<button
name="action_reset_theme_assets"
icon="fa-arrow-right"
type="object"
string="Reset Colors"
class="btn-link"
/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Menu Colors</span>
<div class="text-muted">
@ -100,20 +43,18 @@
<div class="content-group">
<div class="mt16 row">
<label for="theme_color_appbar_color" string="Menu Color" class="col-3 o_light_label"/>
<field name="theme_color_appbar_color" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<field name="theme_color_appbar_color" class="d-block w-25 p-0 m-0" widget="color"/>
<div class="w-100 mt-1"></div>
<label for="theme_color_appbar_background" string="Background" class="col-3 o_light_label"/>
<field name="theme_color_appbar_background" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<field name="theme_color_appbar_background" class="d-block w-25 p-0 m-0" widget="color"/>
<div class="w-100 mt-1"></div>
<label for="theme_color_menu" string="Apps Color" class="col-3 o_light_label"/>
<field name="theme_color_menu" widget="color" class="oe_inline"/>
<field name="theme_color_menu" class="d-block w-25 p-0 m-0" widget="color"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Background Image</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
@ -122,14 +63,25 @@
</div>
<div class="content-group">
<div class="mt16 row">
<label for="theme_background_blend_mode" string="Blend Mode" class="col-3 o_light_label"/>
<field name="theme_background_blend_mode" class="col-5"/>
<div class="w-100"></div>
<field name="theme_background_image" widget="image" class="ml-4 w-75"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Favicon</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Set the favicon for the system
</div>
<div class="content-group">
<div class="mt16 row">
<field name="theme_favicon" widget="image" class="ml-4 oe_avatar"/>
</div>
</div>
</div>
</div>
</div>
</div>
</field>

33
muk_web_theme/views/res_users.xml

@ -1,27 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017-today MuK IT GmbH.
This file is part of MuK Theme
(see https://mukit.at).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<record id="res_users_preferences" model="ir.ui.view">
@ -29,15 +7,8 @@
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<xpath expr="//group[@name='preferences']" position="after">
<group name="preference_theme">
<group >
<field name="sidebar_type" readonly="0"/>
</group>
<group >
<field name="chatter_position" readonly="0" />
</group>
</group>
<xpath expr="//field[@name='tz_offset']" position="after">
<field name="sidebar_type" readonly="0"/>
</xpath>
</field>
</record>

Loading…
Cancel
Save