diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..fc22e8f --- /dev/null +++ b/README.rst @@ -0,0 +1,125 @@ +======================== +Odoo Web Login Screen v8 +======================== +This project aims to give to you the new Odoo Web Login Screen + +Contact +======= + +- Blog: www.xubi.me_ +- Linkedin: binhnguyenxuan_ +- Skype: **xubi.uit** +- Email: **kid.uit.1412@gmail.com** + +.. _www.xubi.me: http://www.xubi.me +.. _binhnguyenxuan: https://www.linkedin.com/in/binhnguyenxuan + +Installation +============ +Installation process is at present stage only possible in manual way. +Then go to you odoo webinterface to the module section and start "Update module list". Then look for the "Odoo Web Login Screen" in Apps (module list) and install. +I hope you enjoy checking out what all you can do with this application. + + +Prerequisite +============ +Before installing the module make sure that the you have configured an addon path for custom addons. In a Linux system the parameter in the config file usually looks similar as the following example: +specify additional addons paths (separated by commas) +addons_path = /opt/odoo/odoo-server/addons, /opt/odoo/custom/addons +In this case you have to install the modules into /opt/odoo/custom/addons. At the present stage on dependency could not automatically resolved so you have to install one extra module that vertical community depends on. + +Usage +===== +Maybe images in github do not fit with the Odoo apps, so you can check: https://apps.odoo.com/apps/modules/8.0/odoo_web_login/ for more details. +Thank you. + +New Feature +=========== +* Apply for module website. + +.. note:: Remmember that, install *odoo_web_login* **after** install module *website*. Or please **upgrade** *odoo_web_login* after install module *website* + + +Configuration +============= + + +.. figure:: config.jpg + :alt: Disable Manage Databases + :scale: 80 % + :align: center + :figclass: text-center + + +Disable Manage Databases +======================== + +.. figure:: disable_manage_database.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Disable Manage Databases + + +Disable Footer +============== + +.. figure:: disable_footer.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Disable Footer + + +Default Login Screen +==================== + +.. figure:: change_background_day.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Default Login Screen + + +Change Background by Hours +========================== + +Night (from 0h -> 3h and 18h -> 23h): +------------------------------------- + + +.. figure:: change_background_night.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Default Login Screen Night + + +Dawn (from 3h -> 7h): +--------------------- + +.. figure:: change_background_dawn.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Default Login Screen Dawn + + +Day (from 7h -> 16h): +--------------------- + +.. figure:: change_background_day.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Default Login Screen Day + + +Dusk (from 16h -> 18h): +----------------------- + +.. figure:: change_background_dusk.jpg + :scale: 80 % + :align: center + :figclass: text-center + :alt: Default Login Screen Dusk diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..25fc8ec --- /dev/null +++ b/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Samples module for Odoo Web Login Screen +# Copyright (C) 2016- XUBI.ME (http://www.xubi.me) +# @author binhnguyenxuan (https://www.linkedin.com/in/binh-nguyen-xuan-46556279) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# +############################################################################## + +import controllers diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..87e07be --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,46 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Samples module for Odoo Web Login Screen +# Copyright (C) 2016- XUBI.ME (http://www.xubi.me) +# @author binhnguyenxuan (https://www.linkedin.com/in/binh-nguyen-xuan-46556279) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# Background Source: http://forum.xda-developers.com/showpost.php?p=37322378 +# +############################################################################## +{ + 'name': 'Odoo Web Login Screen', + 'summary': 'The new configurable Odoo Web Login Screen', + 'version': '8.0.1.0', + 'category': 'Website', + 'summary': """ +The new configurable Odoo Web Login Screen +""", + 'author': "binhnguyenxuan (www.xubi.me)", + 'website': 'http://www.xubi.me', + 'license': 'AGPL-3', + 'depends': [ + ], + 'data': [ + 'data/ir_config_parameter.xml', + 'templates/webclient_templates.xml', + 'templates/website_templates.xml', + ], + 'qweb': [ + ], + 'installable': True, + 'application': True, +} diff --git a/controllers/__init__.py b/controllers/__init__.py new file mode 100644 index 0000000..21383e8 --- /dev/null +++ b/controllers/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Samples module for Odoo Web Login Screen +# Copyright (C) 2016- XUBI.ME (http://www.xubi.me) +# @author binhnguyenxuan (https://www.linkedin.com/in/binh-nguyen-xuan-46556279) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# +############################################################################## + +import main diff --git a/controllers/main.py b/controllers/main.py new file mode 100644 index 0000000..2cc96b9 --- /dev/null +++ b/controllers/main.py @@ -0,0 +1,64 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Samples module for Odoo Web Login Screen +# Copyright (C) 2016- XUBI.ME (http://www.xubi.me) +# @author binhnguyenxuan (https://www.linkedin.com/in/binh-nguyen-xuan-46556279) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# +############################################################################## + +import openerp +import openerp.modules.registry +import ast + +from openerp import http +from openerp.http import request +from openerp.addons.web.controllers.main import Home + +import datetime +import pytz + +#---------------------------------------------------------- +# OpenERP Web web Controllers +#---------------------------------------------------------- +class Home(Home): + + @http.route('/web/login', type='http', auth="none") + def web_login(self, redirect=None, **kw): + cr = request.cr + uid = openerp.SUPERUSER_ID + param_obj = request.registry.get('ir.config_parameter') + request.params['disable_footer'] = ast.literal_eval(param_obj.get_param(cr, uid, 'login_form_disable_footer')) or False + request.params['disable_database_manager'] = ast.literal_eval(param_obj.get_param(cr, uid, 'login_form_disable_database_manager')) or False + + change_background = ast.literal_eval(param_obj.get_param(cr, uid, 'login_form_change_background_by_hour')) or False + if change_background: + config_login_timezone = param_obj.get_param(cr, uid, 'login_form_change_background_timezone') + tz = config_login_timezone and pytz.timezone(config_login_timezone) or pytz.utc + current_hour = datetime.datetime.now(tz=tz).hour or 10 + + if (current_hour >= 0 and current_hour < 3) or (current_hour >= 18 and current_hour < 24): # Night + request.params['background_src'] = param_obj.get_param(cr, uid, 'login_form_background_night') or '' + elif current_hour >= 3 and current_hour < 7: # Dawn + request.params['background_src'] = param_obj.get_param(cr, uid, 'login_form_background_dawn') or '' + elif current_hour >= 7 and current_hour < 16: # Day + request.params['background_src'] = param_obj.get_param(cr, uid, 'login_form_background_day') or '' + else: # Dusk + request.params['background_src'] = param_obj.get_param(cr, uid, 'login_form_background_dusk') or '' + else: + request.params['background_src'] = param_obj.get_param(cr, uid, 'login_form_background_default') or '' + return super(Home, self).web_login(redirect, **kw) diff --git a/data/ir_config_parameter.xml b/data/ir_config_parameter.xml new file mode 100644 index 0000000..087fab1 --- /dev/null +++ b/data/ir_config_parameter.xml @@ -0,0 +1,45 @@ + + + + + login_form_disable_footer + False + + + + login_form_disable_database_manager + False + + + + login_form_change_background_by_hour + True + + + + login_form_change_background_timezone + Etc/GMT-7 + + + + login_form_background_default + /odoo_web_login/static/src/img/background_login_2.png + + + login_form_background_dawn + /odoo_web_login/static/src/img/background_login_1.png + + + login_form_background_day + /odoo_web_login/static/src/img/background_login_2.png + + + login_form_background_dusk + /odoo_web_login/static/src/img/background_login_3.png + + + login_form_background_night + /odoo_web_login/static/src/img/background_login_4.png + + + diff --git a/static/description/change_background_dawn.jpg b/static/description/change_background_dawn.jpg new file mode 100644 index 0000000..6787978 Binary files /dev/null and b/static/description/change_background_dawn.jpg differ diff --git a/static/description/change_background_day.jpg b/static/description/change_background_day.jpg new file mode 100644 index 0000000..be3391f Binary files /dev/null and b/static/description/change_background_day.jpg differ diff --git a/static/description/change_background_dusk.jpg b/static/description/change_background_dusk.jpg new file mode 100644 index 0000000..4eb5315 Binary files /dev/null and b/static/description/change_background_dusk.jpg differ diff --git a/static/description/change_background_night.jpg b/static/description/change_background_night.jpg new file mode 100644 index 0000000..36517d3 Binary files /dev/null and b/static/description/change_background_night.jpg differ diff --git a/static/description/config.jpg b/static/description/config.jpg new file mode 100644 index 0000000..abbdf7a Binary files /dev/null and b/static/description/config.jpg differ diff --git a/static/description/disable_footer.jpg b/static/description/disable_footer.jpg new file mode 100644 index 0000000..7a57e51 Binary files /dev/null and b/static/description/disable_footer.jpg differ diff --git a/static/description/disable_manage_database.jpg b/static/description/disable_manage_database.jpg new file mode 100644 index 0000000..bef1f58 Binary files /dev/null and b/static/description/disable_manage_database.jpg differ diff --git a/static/description/icon.png b/static/description/icon.png new file mode 100644 index 0000000..596acad Binary files /dev/null and b/static/description/icon.png differ diff --git a/static/src/css/web_login_style.css b/static/src/css/web_login_style.css new file mode 100644 index 0000000..a5ff843 --- /dev/null +++ b/static/src/css/web_login_style.css @@ -0,0 +1,128 @@ +/* + MAIN STYLE +*/ +@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,500&subset=latin,vietnamese); + +body, html { + font-family: 'Roboto', sans-serif; + font-size: 14px; + margin: 0; + padding: 0; + height: 100%; +} + +.body_login { + display: inline-block; + text-align: center; + white-space: nowrap; + width: 100%; + height: 100%; + position: relative; +} + +.body_login:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; + margin-right: -0.25em; +} + +.o_database_list { + display: inline-block; + vertical-align: middle; + padding: 40px; + border: 1px solid #DDD; + border-radius: 5px; + float: none; + background-color: #FFF; + opacity: 0.9; +} + +#background-wrapper { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: block; + background-repeat: no-repeat; + background-position: center center; + background-attachment: fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + -webkit-filter: blur(0px); + z-index: -1; +} + +.o_database_list input, +.o_database_list select { + background-color: transparent !important; + border-top: 0px; + border-left: 0px; + border-right: 0px; + border-bottom: 1px solid #CCC; + border-radius: 0px; + color: #de3907; + font-size: 18px; + font-weight: 300; + transition: border-color 0.7s ease; + box-shadow: none!important; + text-align: center; +} + +.o_database_list select option { + background-color: #95A5A6; +} + +.o_database_list input:focus, +.o_database_list select:focus { + border-bottom: 1px solid #e0953e; + outline: 0 none; +} + +a.btn-select { + background-color: #BBB; + border-radius: 5px !important; + color: #EEE; +} + +.o_database_list .btn-primary { + color: #FFF; + background-color: #BBB; + border: 1px solid #CCC; + text-transform: uppercase; + transition: background-color 0.5s ease; +} + +.o_database_list .btn-primary:hover, +a.btn-select:hover { + background-color: #f05a24; + color: #FFF; +} + +.form-control { + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0); +} + +.o_database_list .company_logo { + margin-bottom: 30px; + max-width: 100%; + height: auto; +} + +.oe_login_buttons { + margin-top: 30px; + margin-bottom: 10px; +} + +.oe_login_form .form-control { + height: 36px; +} + +.oe_single_form_footer { + margin-top: 20px; +} diff --git a/static/src/img/background_login_1.png b/static/src/img/background_login_1.png new file mode 100644 index 0000000..5f888db Binary files /dev/null and b/static/src/img/background_login_1.png differ diff --git a/static/src/img/background_login_2.png b/static/src/img/background_login_2.png new file mode 100644 index 0000000..dbd313a Binary files /dev/null and b/static/src/img/background_login_2.png differ diff --git a/static/src/img/background_login_3.png b/static/src/img/background_login_3.png new file mode 100644 index 0000000..bece9a4 Binary files /dev/null and b/static/src/img/background_login_3.png differ diff --git a/static/src/img/background_login_4.png b/static/src/img/background_login_4.png new file mode 100644 index 0000000..81fb912 Binary files /dev/null and b/static/src/img/background_login_4.png differ diff --git a/templates/webclient_templates.xml b/templates/webclient_templates.xml new file mode 100644 index 0000000..a569199 --- /dev/null +++ b/templates/webclient_templates.xml @@ -0,0 +1,49 @@ + + + + + + + + + + diff --git a/templates/website_templates.xml b/templates/website_templates.xml new file mode 100644 index 0000000..6568106 --- /dev/null +++ b/templates/website_templates.xml @@ -0,0 +1,6 @@ + + + + + +