Inital commit

This commit is contained in:
Tobias Herre 2020-12-04 13:35:31 +01:00
parent 9f6be842f6
commit ab2602397c
21 changed files with 511 additions and 0 deletions

125
README.rst Normal file
View File

@ -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

24
__init__.py Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
#
#
##############################################################################
import controllers

46
__openerp__.py Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
#
# 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,
}

24
controllers/__init__.py Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
#
#
##############################################################################
import main

64
controllers/main.py Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
#
#
##############################################################################
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)

View File

@ -0,0 +1,45 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="0">
<record id="login_form_disable_footer" model="ir.config_parameter">
<field name="key">login_form_disable_footer</field>
<field name="value">False</field>
</record>
<record id="login_form_disable_database_manager" model="ir.config_parameter">
<field name="key">login_form_disable_database_manager</field>
<field name="value">False</field>
</record>
<record id="login_form_change_background_by_hour" model="ir.config_parameter">
<field name="key">login_form_change_background_by_hour</field>
<field name="value">True</field>
</record>
<record id="login_form_change_background_timezone" model="ir.config_parameter">
<field name="key">login_form_change_background_timezone</field>
<field name="value">Etc/GMT-7</field>
</record>
<record id="login_form_background_default" model="ir.config_parameter">
<field name="key">login_form_background_default</field>
<field name="value">/odoo_web_login/static/src/img/background_login_2.png</field>
</record>
<record id="login_form_background_dawn" model="ir.config_parameter">
<field name="key">login_form_background_dawn</field>
<field name="value">/odoo_web_login/static/src/img/background_login_1.png</field>
</record>
<record id="login_form_background_day" model="ir.config_parameter">
<field name="key">login_form_background_day</field>
<field name="value">/odoo_web_login/static/src/img/background_login_2.png</field>
</record>
<record id="login_form_background_dusk" model="ir.config_parameter">
<field name="key">login_form_background_dusk</field>
<field name="value">/odoo_web_login/static/src/img/background_login_3.png</field>
</record>
<record id="login_form_background_night" model="ir.config_parameter">
<field name="key">login_form_background_night</field>
<field name="value">/odoo_web_login/static/src/img/background_login_4.png</field>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
static/description/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 KiB

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="login_layout" inherit_id="web.login_layout" name="Login Layout Inherit">
<xpath expr="//t[@t-set='body_classname']" position="replace">
<t t-set="body_classname" t-value="'body_login'"/>
</xpath>
<xpath expr="//t[@t-set='head']/link[last()]" position="inside">
<link rel="stylesheet" href="/odoo_web_login/static/src/css/web_login_style.css"/>
</xpath>
<xpath expr="//div[@class='oe_single_form_container modal-content']" position="before">
<div id="background-wrapper" t-attf-style="background-image: url('#{background_src}');"></div>
</xpath>
<xpath expr="//div[@class='oe_single_form_container modal-content']" position="attributes">
<attribute name="class">col-lg-3 col-md-4 col-sm-4 col-xs-11 o_database_list</attribute>
</xpath>
<xpath expr="//hr" position="replace" />
<xpath expr="//div[@class='oe_single_form_logo']/img" position="attributes">
<attribute name="class">company_logo</attribute>
</xpath>
</template>
<template id="login" inherit_id="web.login" name="Login Inherit">
<xpath expr="//label[@for='login']" position="replace" />
<xpath expr="//label[@for='password']" position="replace" />
<xpath expr="//input[@name='login']" position="attributes">
<attribute name="placeholder">Email ...</attribute>
<attribute name="autocomplete">off</attribute>
<attribute name="autocorrect">off</attribute>
</xpath>
<xpath expr="//input[@name='password']" position="attributes">
<attribute name="placeholder">Password ...</attribute>
</xpath>
</template>
<template id="inherit_web_dbselect" inherit_id="web.database_select" name="DB Select Inherit">
<xpath expr="//label[@for='db']" position="replace" />
</template>
</data>
</openerp>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<delete model="ir.ui.view" search="[('id','=', ref('website.login_layout'))]"/>
</data>
</openerp>