Upload module from light25

This commit is contained in:
Mazen Abdo 2025-08-07 10:20:22 +03:00
parent 789feae328
commit 40347ee8d2
43 changed files with 868 additions and 3 deletions

View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Meghsundar Private Limited(<https://www.meghsundar.com>).
#
###############################################################################
from . import controllers
from . import models

View File

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Meghsundar Private Limited(<https://www.meghsundar.com>).
#
###############################################################################
{
'name': 'Login Background',
'summary': 'Configure Odoo Web Login Screen',
'description': 'Configure Odoo Web Login Screen',
'version': '14.0.1',
'license': 'AGPL-3',
'author': 'Meghsundar Private Limited',
'website': 'https://meghsundar.com',
'category': 'Web',
'depends': ['base', 'base_setup', 'web'],
'data': [
'security/ir.model.access.csv',
'views/res_config_settings_views_inherit.xml',
'views/image_login.xml',
'templates/left_login_template.xml',
'templates/right_login_template.xml',
'templates/middle_login_template.xml',
'templates/assets.xml',
],
'images': ['static/description/banner.gif'],
'installable': True,
'auto_install': False,
'application': False,
}

View File

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Meghsundar Private Limited(<https://www.meghsundar.com>).
#
###############################################################################
from . import main

View File

@ -0,0 +1,127 @@
import logging
import werkzeug.exceptions
import werkzeug.utils
from werkzeug.urls import iri_to_uri
import odoo
from odoo.tools.translate import _
from odoo import http, tools
from odoo.http import request, Response
_logger = logging.getLogger(__name__)
db_monodb = http.db_monodb
def _get_login_redirect_url(uid, redirect=None):
if request.session.uid: # fully logged
return redirect or '/web'
url = request.env(user=uid)['res.users'].browse(uid)._mfa_url()
if not redirect:
return url
parsed = werkzeug.urls.url_parse(url)
qs = parsed.decode_query()
qs['redirect'] = redirect
return parsed.replace(query=werkzeug.urls.url_encode(qs)).to_url()
def abort_and_redirect(url):
r = request.httprequest
response = werkzeug.utils.redirect(url, 302)
response = r.app.get_response(r, response, explicit_session=False)
werkzeug.exceptions.abort(response)
def ensure_db(redirect='/web/database/selector'):
db = request.params.get('db') and request.params.get('db').strip()
if db and db not in http.db_filter([db]):
db = None
if db and not request.session.db:
r = request.httprequest
url_redirect = werkzeug.urls.url_parse(r.base_url)
if r.query_string:
query_string = iri_to_uri(r.query_string)
url_redirect = url_redirect.replace(query=query_string)
request.session.db = db
abort_and_redirect(url_redirect)
if not db and request.session.db and http.db_filter([request.session.db]):
db = request.session.db
if not db:
db = db_monodb(request.httprequest)
if not db:
werkzeug.exceptions.abort(werkzeug.utils.redirect(redirect, 303))
if db != request.session.db:
request.session.logout()
abort_and_redirect(request.httprequest.url)
request.session.db = db
class Home(http.Controller):
def _login_redirect(self, uid, redirect=None):
return _get_login_redirect_url(uid, redirect)
@http.route('/web/login', type='http', auth="none")
def web_login(self, redirect=None, **kw):
ensure_db()
request.params['login_success'] = False
if request.httprequest.method == 'GET' and redirect and request.session.uid:
return http.redirect_with_hash(redirect)
if not request.uid:
request.uid = odoo.SUPERUSER_ID
values = request.params.copy()
try:
values['databases'] = http.db_list()
except odoo.exceptions.AccessDenied:
values['databases'] = None
if request.httprequest.method == 'POST':
old_uid = request.uid
try:
uid = request.session.authenticate(request.session.db, request.params['login'],
request.params['password'])
request.params['login_success'] = True
return http.redirect_with_hash(self._login_redirect(uid, redirect=redirect))
except odoo.exceptions.AccessDenied as e:
request.uid = old_uid
if e.args == odoo.exceptions.AccessDenied().args:
values['error'] = _("Wrong login/password")
else:
values['error'] = e.args[0]
else:
if 'error' in request.params and request.params.get('error') == 'access':
values['error'] = _('Only employees can access this database. Please contact the administrator.')
if 'login' not in values and request.session.get('auth_login'):
values['login'] = request.session.get('auth_login')
if not odoo.tools.config['list_db']:
values['disable_database_manager'] = True
param_obj = request.env['ir.config_parameter'].sudo()
style = param_obj.get_param('mpl_login_background.style')
background = param_obj.get_param('mpl_login_background.background')
values['background_color'] = param_obj.get_param('mpl_login_background.color')
b_image = param_obj.get_param('mpl_login_background.b_image')
if background == 'image':
image_url = ''
if b_image:
base_url = param_obj.get_param('web.base.url')
image_url = base_url + '/web/image?' + 'model=image.login&id=' + b_image + '&field=image'
values['background_src'] = image_url or ''
values['background_color'] = ''
if background == 'color':
values['background_src'] = ''
if style == 'default' or style is False:
response = request.render('web.login', values)
elif style == 'left':
response = request.render('mpl_login_background.left_login_template', values)
elif style == 'right':
response = request.render('mpl_login_background.right_login_template', values)
else:
response = request.render('mpl_login_background.middle_login_template', values)
response.headers['X-Frame-Options'] = 'DENY'
return response
class Website(Home):
@http.route(website=True, auth="public", sitemap=False)
def web_login(self, *args, **kw):
return super().web_login(*args, **kw)

View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Meghsundar Private Limited(<https://www.meghsundar.com>).
#
###############################################################################
from . import res_config_settings_inherit
from . import image_login

View File

@ -0,0 +1,10 @@
from odoo import models, fields, api, _
class LoginImage(models.Model):
_name = 'image.login'
_description = 'Image Login'
_rec_name = 'name'
image = fields.Binary(string="Image")
name = fields.Char(string="Name")

View File

@ -0,0 +1,48 @@
from odoo import api, fields, models, modules
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
style = fields.Selection([
('left', 'Left'),
('right', 'Right'),
('middle', 'Middle')], default='middle', help='Select Background Theme')
background = fields.Selection([('image', 'Image'), ('color', 'Color')], default='color', help='Select Background Theme')
b_image = fields.Many2one('image.login', string="Image", help='Select Background Image For Login Page')
color = fields.Char(string="Color", help="Choose your Background color")
@api.onchange('background')
def onchange_background(self):
if self.background == 'image':
self.color = False
elif self.background == 'color':
self.b_image = False
else:
self.b_image = self.color = False
@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
image_id = int(self.env['ir.config_parameter'].sudo().get_param('mpl_login_background.b_image'))
res.update(
b_image=image_id,
color=self.env['ir.config_parameter'].sudo().get_param('mpl_login_background.color'),
background=self.env['ir.config_parameter'].sudo().get_param('mpl_login_background.background'),
style=self.env['ir.config_parameter'].sudo().get_param('mpl_login_background.style'),
)
return res
def set_values(self):
super(ResConfigSettings, self).set_values()
param = self.env['ir.config_parameter'].sudo()
set_image = self.b_image.id or False
set_color = self.color or False
set_background = self.background or False
set_style = self.style or False
param.set_param('mpl_login_background.b_image', set_image)
param.set_param('mpl_login_background.color', set_color)
param.set_param('mpl_login_background.background', set_background)
param.set_param('mpl_login_background.style', set_style)

View File

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_image_login,access_image_login,model_image_login,,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_image_login access_image_login model_image_login 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Description</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
crossorigin="anonymous">
</head>
<body>
<section>
<div style="background-color: #b3e3ea; padding-top: 2%; padding-bottom: 2%; box-shadow: 0 8px 25px 0 rgba(134 ,192, 206,1);"
class="container-fluid header">
<div class="justify-content-center align-item-center text-center">
<img width="40%" src="./meghsundar_logo_footer.png" alt="">
</div>
<div class="justify-content-center align-item-center text-center mt-5">
<p style="font-size: 28px; color: #0082c0; font-weight: 800;">info@meghsundar.com | +919426550327 | 24x7 Service</p>
</div>
<div class="container mt-5 justify-content-center align-item-center">
<div class="row justify-content-center align-item-center">
<div class="d-flex col-xl-auto justify-content-center align-item-center p-0">
<p style="font-size: 19px; color: #0082c0; font-weight: 500;">Odoo Implementation | Odoo Training | Odoo Customization | Odoo Integration</p>
</div>
</div>
</div>
</div>
</section>
<br>
<section class="oe_container oe_dark lead mt-5">
<div class="oe_row" style="width: 100% !important;">
<div class="oe_span12" style="width: 100% !important;">
<div class="panel panel-primary" style="border:none">
<div class="panel-body screen-img">
<div style="border-radius: 25px; background-color:#b3e3ea; transition: .5s ease-in-out; color:#0082c0; font-weight: bolder; box-shadow: 0px 5px 10px 0px rgba(134 ,192, 206,1); border: none;"
class="alert alert-info text-center title-box container">
<h1><i class="fa fa-hand-o-right"></i>
<strong>Configure Login Page by image or color</strong>
</h1>
</div>
<div class="container text-center">
<p style="font-weight: bolder; color: #0082c0; font-size: 28px;">Main Features</p>
<strong><p style="font-weight: bolder; color: #0082c0;" class="text-left"></p></strong>
<strong><p style="font-weight: bolder; color: #0082c0;" class="text-left">
Configure Login Page by image or color</p>
</strong>
<br>
<p style="font-weight: bolder; color: #0082c0; font-size: 20px;"><b>
Set image for login page</b></p>
<br>
<img style="border-radius: 20px; border: 2px solid #46466d;" width="100%"
class="border border-info" src="./img.png" alt="">
<br>
<br>
<img style="border-radius: 20px; border: 2px solid #46466d;" width="100%"
class="border border-info" src="./1.png" alt="">
<br>
<br>
<p style="font-weight: bolder; color: #0082c0; font-size: 20px;"><b>
Image at login page</b></p>
<br>
<img style="border-radius: 20px; border: 2px solid #46466d;" width="100%"
class="border border-info" src="./2.png" alt="">
<br>
<br>
<br>
<p style="font-weight: bolder; color: #0082c0; font-size: 20px;"><b>
Set color for login page</b></p>
<br>
<img style="border-radius: 20px; border: 2px solid #46466d;" width="100%"
class="border border-info" src="./3.png" alt="">
<br>
<br>
<p style="font-weight: bolder; color: #0082c0; font-size: 20px;"><b>
Color at login page</b></p>
<br>
<img style="border-radius: 20px; border: 2px solid #46466d;" width="100%"
class="border border-info" src="./4.png" alt="">
<br>
<br>
</div>
<br>
</div>
</div>
</div>
</div>
</section>
<br>
<section class="oe_container oe_dark lead container">
<div class="panel-body" style="text-align: center;">
<ul class="list-unstyled">
<div style="border-radius: 25px; background-color:#b3e3ea; transition: .5s ease-in-out; color:#0082c0; font-weight: bolder; box-shadow: 0px 5px 10px 0px rgba(134 ,192, 206,1); border: none;"
class="alert alert-info title-box"><i class="fa fa-globe" aria-hidden="true"></i> <strong> Our
Service </strong></div>
</ul>
<div class="container text-center justify-content-center align-item-center">
<div class="row">
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Migration.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Migration</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Training.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Training</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Customization.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Customization</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Implementation.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Implementation</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Integration.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Integration</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Consulting.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Consulting</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Support.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Support</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/Hire.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Odoo Hire</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/website.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
Website Development</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/cell-phone.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
App Development</p>
</div>
</div>
<div class="col-xl-3 mt-5">
<div style="padding: 20px; max-width: 300px; border-radius: 15px; box-shadow: rgba(134 ,192, 206,1) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;"
class="service-box container justify-content-center align-item-center text-center">
<img width="35%" src="./service/seo.png" alt="">
<p style="margin-bottom: 0; margin-top: 5px; font-size: 18px; font-weight: bold; color: #0082c0;">
SEO</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark lead mt-5">
<div class="oe_row" style="width: 100% !important;">
<div class="oe_span12" style="width: 100% !important;">
<div class="panel panel-primary" style="border:none">
<div class="panel-body" style="text-align: center;">
<ul class="list-unstyled">
<div style="border-radius: 25px; background-color:#b3e3ea; transition: .5s ease-in-out; color:#0082c0; font-weight: bolder; box-shadow: 0px 5px 10px 0px rgba(134 ,192, 206,1); border: none;"
class="alert alert-info title-box container">
<strong> Get Help & Support </strong>
</div>
<li style="color: #0082c0;"><i class="fa fa-key" style="color:#0082c0"></i> You will get
30 Days free support incase any bugs or issue.
</li>
<br>
</ul>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark lead">
<div class="oe_row" style="width: 100% !important;">
<div style="background-color: #b3e3ea; padding-top: 2%; padding-bottom: 2%; box-shadow: 0 8px 25px 0 rgba(134 ,192, 206,1);"
class="footer">
<div class="container">
<div class="justify-content-center align-item-center text-center">
<img width="40%" src="./meghsundar_logo_footer.png" alt="">
</div>
<div style="margin-top: 2%;"
class="row justify-content-center align-item-center text-center sco-icon">
<div class="col-xl-4">
<div>
<img width="15%" src="./website.png" alt="">
<p style="color: #0082c0; font-size: 18px; font-weight: 400; padding-top: 20px;">
www.meghsundar.com</p>
</div>
</div>
<div class="col-xl-4">
<div>
<img width="15%" src="./mail.png" alt="">
<p style="color: #0082c0; font-size: 18px; font-weight: 400; padding-top: 20px;">
info@meghsundar.com</p>
</div>
</div>
<div class="col-xl-4">
<div>
<img width="15%" src="./skype.png" alt="">
<p style="color: #0082c0; font-size: 18px; font-weight: 400; padding-top: 20px;">
info@meghsundar.com</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!--Bootstrap Js-->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
crossorigin="anonymous"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,55 @@
.container{
max-width: 100%;
}
#background{
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;
}
.body_login {
display: inline-block;
text-align: center;
white-space: nowrap;
width: 100%;
position: relative;
margin: 0px;
padding: 0px;
opacity:0.7;
}
#mcard{
margin-top: 7%;
padding: 3%;
max-width:350px
}
#bcard{
padding: 3%;
height: 100%;
}
.body_login input,
.body_login select {
background-color: transparent !important;
border-top: 0px;
border-left: 0px;
border-right: 0px;
border-bottom: 1px solid #FED766;
border-radius: 0px;
color: black;
font-size: 18px;
font-weight: 300;
transition: border-color 0.7s ease;
box-shadow: none!important;
text-align: center;
}
.effect:hover{
box-shadow: 5px 5px 5px black;
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_login" inherit_id="web.assets_frontend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mpl_login_background/static/src/css/web_login_style.css"/>
</xpath>
</template>
</odoo>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="left_login_layout" name="Left Login Layout">
<t t-call="web.frontend_layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="body_classname" t-value="'bg-100'"/>
<t t-set="no_header" t-value="True"/>
<t t-set="no_footer" t-value="True"/>
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
<div class="container body_login" style="height: 100%;">
<div id="bcard" t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" style="float:left;">
<div class="card-body">
<div style="margin-top: 30%;">
<div t-attf-class="text-center pb-3 border-bottom {{'mb-3' if form_small else 'mb-4'}}">
<img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}" alt="Logo" style="max-height:120px; max-width: 100%; width:auto"/>
</div>
<t t-raw="0"/>
<div class="text-center small mt-4 pt-3 border-top" t-if="not disable_footer">
<t t-if="not disable_database_manager">
<a class="border-right pr-2 mr-1" href="/web/database/manager">Manage Databases</a>
</t>
<a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Odoo</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="left_login_template" name="Left Login">
<t t-call="mpl_login_background.left_login_layout">
<form class="oe_login_form" role="form" t-attf-action="/web/login" method="post" onsubmit="this.action = '/web/login' + location.hash">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group field-db" t-if="databases and len(databases) &gt; 1">
<div t-attf-class="input-group {{'input-group-sm' if form_small else ''}}">
<input type="text" name="db" t-att-value="request.db" id="db" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" readonly="readonly"/>
<span class="input-group-append">
<a role="button" href="/web/database/selector" class="btn btn-secondary">Select <i class="fa fa-database" role="img" aria-label="Database" title="Database"></i></a>
</span>
</div>
</div>
<div class="form-group field-login effect">
<input type="text" placeholder="Email ..." name="login" t-att-value="login" id="login" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autofocus="autofocus" autocapitalize="off"/>
</div>
<div class="form-group field-password effect">
<input type="password" placeholder="Password ..." name="password" id="password" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autocomplete="current-password" t-att-autofocus="'autofocus' if login else None" maxlength="4096"/>
</div>
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<p class="alert alert-success" t-if="message" role="status">
<t t-esc="message"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>
<div class="o_login_auth"/>
</div>
<input type="hidden" name="redirect" t-att-value="redirect"/>
</form>
</t>
</template>
</odoo>

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="middle_login_layout" name="Middle Login Layout">
<t t-call="web.layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="head">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web.assets_frontend" t-css="false"/>
</t>
<t t-set="body_classname" t-value="'bg-100'"/>
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
<div class="container body_login">
<div t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" id="mcard">
<div class="card-body">
<div>
<div t-attf-class="text-center pb-3 border-bottom {{'mb-3' if form_small else 'mb-4'}}">
<img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}" alt="Logo" style="max-height:120px; max-width: 100%; width:auto"/>
</div>
<t t-raw="0"/>
<div class="text-center small mt-4 pt-3 border-top" t-if="not disable_footer">
<t t-if="not disable_database_manager">
<a class="border-right pr-2 mr-1" href="/web/database/manager">Manage Databases</a>
</t>
<a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Odoo</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="middle_login_template" name="Middle Login">
<t t-call="mpl_login_background.middle_login_layout">
<form class="oe_login_form" role="form" t-attf-action="/web/login" method="post" onsubmit="this.action = '/web/login' + location.hash">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group field-db" t-if="databases and len(databases) &gt; 1">
<div t-attf-class="input-group {{'input-group-sm' if form_small else ''}}">
<input type="text" name="db" t-att-value="request.db" id="db" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" readonly="readonly"/>
<span class="input-group-append">
<a role="button" href="/web/database/selector" class="btn btn-secondary">Select <i class="fa fa-database" role="img" aria-label="Database" title="Database"></i></a>
</span>
</div>
</div>
<div class="form-group field-login effect">
<input type="text" placeholder="Email ..." name="login" t-att-value="login" id="login" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autofocus="autofocus" autocapitalize="off"/>
</div>
<div class="form-group field-password effect">
<input type="password" placeholder="Password ..." name="password" id="password" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autocomplete="current-password" t-att-autofocus="'autofocus' if login else None" maxlength="4096"/>
</div>
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<p class="alert alert-success" t-if="message" role="status">
<t t-esc="message"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>
<div class="o_login_auth"/>
</div>
<input type="hidden" name="redirect" t-att-value="redirect"/>
</form>
</t>
</template>
</odoo>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="right_login_layout" name="right Login Layout">
<t t-call="web.frontend_layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="body_classname" t-value="'bg-100'"/>
<t t-set="no_header" t-value="True"/>
<t t-set="no_footer" t-value="True"/>
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
<div class="container body_login" style="height: 100%;">
<div id="bcard" t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" style="float:right;">
<div class="card-body">
<div style="margin-top: 30%;">
<div t-attf-class="text-center pb-3 border-bottom {{'mb-3' if form_small else 'mb-4'}}">
<img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}" alt="Logo" style="max-height:120px; max-width: 100%; width:auto"/>
</div>
<t t-raw="0"/>
<div class="text-center small mt-4 pt-3 border-top" t-if="not disable_footer">
<t t-if="not disable_database_manager">
<a class="border-right pr-2 mr-1" href="/web/database/manager">Manage Databases</a>
</t>
<a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Odoo</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="mpl_login_background.right_login_template" name="right Login">
<t t-call="mpl_login_background.right_login_layout">
<form class="oe_login_form" role="form" t-attf-action="/web/login" method="post" onsubmit="this.action = '/web/login' + location.hash">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group field-db" t-if="databases and len(databases) &gt; 1">
<div t-attf-class="input-group {{'input-group-sm' if form_small else ''}}">
<input type="text" name="db" t-att-value="request.db" id="db" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" readonly="readonly"/>
<span class="input-group-append">
<a role="button" href="/web/database/selector" class="btn btn-secondary">Select <i class="fa fa-database" role="img" aria-label="Database" title="Database"></i></a>
</span>
</div>
</div>
<div class="form-group field-login effect">
<input type="text" placeholder="Email ..." name="login" t-att-value="login" id="login" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autofocus="autofocus" autocapitalize="off"/>
</div>
<div class="form-group field-password effect">
<input type="password" placeholder="Password ..." name="password" id="password" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autocomplete="current-password" t-att-autofocus="'autofocus' if login else None" maxlength="4096"/>
</div>
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<p class="alert alert-success" t-if="message" role="status">
<t t-esc="message"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>
<div class="o_login_auth"/>
</div>
<input type="hidden" name="redirect" t-att-value="redirect"/>
</form>
</t>
</template>
</odoo>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="view_login_tree">
<field name="name">image.login</field>
<field name="model">image.login</field>
<field name="priority" eval="16"/>
<field name="arch" type="xml">
<tree string="faculty list">
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_login_form">
<field name="name">image.login</field>
<field name="model">image.login</field>
<field name="priority" eval="16"/>
<field name="arch" type="xml">
<form string="Image">
<group>
<field name="name" invisible="0" readonly="1" force_save="1"/>
<field widget="binary" height="64" name="image" filename="name" />
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_image_data">
<field name="name">Image</field>
<field name="res_model">image.login</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="menu_image" name="Background Image" parent="base.menu_users" action="mpl_login_background.action_image_data"/>
</data>
</odoo>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="res_config_settings_view_form_login_background" model="ir.ui.view">
<field name="name">res.config.settings.form.inherit</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='companies']" position="after">
<div>
<h2>Login Background</h2>
<div class="row mt16 o_settings_container"
name="default_taxes_setting_container">
<div class="col-12 col-lg-6 o_setting_box"
id="default_taxes">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<div class="content-group">
<div class="row mt16">
<label string="Style" for="style" class="col-lg-3 o_light_label"/>
<field name="style"/>
<label string="Background" for="background" class="col-lg-3 o_light_label"
attrs="{'invisible': [('style','in',[False])]}"/>
<field name="background"
attrs="{'invisible': [('style','in',[False])]}"/>
<label string="Image" for="b_image" class="col-lg-3 o_light_label"
attrs="{'invisible': [('background','!=','image')]}"/>
<field name="b_image" options="{'no_create': True}"
attrs="{'invisible': [('background','!=','image')], 'required':[('background', '=', 'image')]}"/>
<label string="Color" for="color" class="col-lg-3 o_light_label"
attrs="{'invisible': [('background','!=','color')]}"/>
<field name="color" widget="color"
attrs="{'invisible': [('background','!=','color')]}"/>
</div>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Customize web menu security --> <!-- Customize web menu security -->
<odoo> <odoo>
<record model="ir.ui.menu" id="website.menu_website_configuration"> <!-- <record model="ir.ui.menu" id="website.menu_website_configuration">-->
<field name="groups_id" eval="[(6,0,[ref('website.group_website_publisher')])]"/> <!-- <field name="groups_id" eval="[(6,0,[ref('website.group_website_publisher')])]"/>-->
</record> <!-- </record>-->
</odoo> </odoo>