@ -0,0 +1,56 @@ |
|||
.. image:: https://img.shields.io/badge/licence-GPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/gpl-3.0-standalone.html |
|||
:alt: License: GPL-3 |
|||
|
|||
=============== |
|||
Odoo Debranding |
|||
=============== |
|||
|
|||
Debranding of odoo with the given configurations under Website Admin -> Debranding Configurations. |
|||
Will replace: |
|||
- Page Title |
|||
- Odoo from Popups |
|||
- Settings Odoo branding Items |
|||
- User Drop down Odoo links |
|||
- Website Title, footer |
|||
- Powered By Odoo on Backend by your company name |
|||
- Odoo label from Dialogues |
|||
- Odoo Database Selector Logo, Labels |
|||
- Copyright @odoo with your company on website page |
|||
|
|||
|
|||
|
|||
|
|||
Installation |
|||
============ |
|||
|
|||
To install this module from odoo apps after updating the app list. |
|||
|
|||
|
|||
Usage |
|||
===== |
|||
|
|||
Fill the configuration under Website Admin. Clear Browser Image caches after installing the module. |
|||
|
|||
Known issues / Roadmap |
|||
====================== |
|||
|
|||
* ... |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Contact odoo@cybrosys.com |
|||
|
|||
|
|||
Contributors |
|||
------------ |
|||
|
|||
* Hilar AK <hilar@cybrosys.in> |
|||
|
|||
Maintainer |
|||
---------- |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit https://www.cybrosys.com. |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import controllers |
|||
from . import models |
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Hilar AK(<hilar@cybrosys.in>) |
|||
# you can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# It is forbidden to publish, distribute, sublicense, or sell copies |
|||
# of the Software or modified copies of the Software. |
|||
# |
|||
# 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 (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': "Odoo Debranding", |
|||
'version': "10.0.1.0", |
|||
'summary': """Debrand Odoo""", |
|||
'description': """Debrand Odoo""", |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': "Cybrosys Techno Solutions", |
|||
'website': "https://cybrosys.com/", |
|||
'category': 'Tools', |
|||
'depends': ['base', 'im_livechat', 'website'], |
|||
'data': [ |
|||
'views/views.xml', |
|||
'views/templates.xml'], |
|||
'demo': [], |
|||
'qweb': ["static/src/xml/*.xml"], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': "LGPL-3", |
|||
'installable': True, |
|||
'application': False |
|||
} |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import controllers |
@ -0,0 +1,98 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import imghdr |
|||
import json |
|||
import functools |
|||
from odoo import http, tools |
|||
import odoo, os, sys, jinja2 |
|||
from odoo.addons.web.controllers.main import Database |
|||
from odoo.addons.web.controllers import main |
|||
from odoo.addons.web.controllers.main import Binary |
|||
from odoo.modules import get_resource_path |
|||
from cStringIO import StringIO |
|||
from odoo.http import request |
|||
|
|||
if hasattr(sys, 'frozen'): |
|||
# When running on compiled windows binary, we don't have access to package loader. |
|||
path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'views')) |
|||
loader = jinja2.FileSystemLoader(path) |
|||
else: |
|||
loader = jinja2.PackageLoader('odoo.addons.odoo-debrand', "views") |
|||
env = main.jinja2.Environment(loader=loader, autoescape=True) |
|||
env.filters["json"] = json.dumps |
|||
db_monodb = http.db_monodb |
|||
|
|||
|
|||
class BinaryCustom(Binary): |
|||
@http.route([ |
|||
'/web/binary/company_logo', |
|||
'/logo', |
|||
'/logo.png', |
|||
], type='http', auth="none") |
|||
def company_logo(self, dbname=None, **kw): |
|||
imgname = 'logo' |
|||
imgext = '.png' |
|||
company_logo = request.env['website'].sudo().search([])[0].company_logo |
|||
custom_logo = tools.image_resize_image(company_logo, (150, None)) |
|||
placeholder = functools.partial(get_resource_path, 'web', 'static', 'src', 'img') |
|||
uid = None |
|||
if request.session.db: |
|||
dbname = request.session.db |
|||
uid = request.session.uid |
|||
elif dbname is None: |
|||
dbname = db_monodb() |
|||
|
|||
if not uid: |
|||
uid = odoo.SUPERUSER_ID |
|||
|
|||
if not dbname: |
|||
response = http.send_file(placeholder(imgname + imgext)) |
|||
else: |
|||
try: |
|||
# create an empty registry |
|||
registry = odoo.modules.registry.Registry(dbname) |
|||
if custom_logo: |
|||
image_base64 = custom_logo.decode('base64') |
|||
image_data = StringIO(image_base64) |
|||
imgext = '.' + (imghdr.what(None, h=image_base64) or 'png') |
|||
response = http.send_file(image_data, filename=imgname + imgext, mtime=None) |
|||
else: |
|||
with registry.cursor() as cr: |
|||
cr.execute("""SELECT c.logo_web, c.write_date |
|||
FROM res_users u |
|||
LEFT JOIN res_company c |
|||
ON c.id = u.company_id |
|||
WHERE u.id = %s |
|||
""", (uid,)) |
|||
row = cr.fetchone() |
|||
if row and row[0]: |
|||
image_base64 = str(row[0]).decode('base64') |
|||
image_data = StringIO(image_base64) |
|||
imgext = '.' + (imghdr.what(None, h=image_base64) or 'png') |
|||
response = http.send_file(image_data, filename=imgname + imgext, mtime=row[1]) |
|||
else: |
|||
response = http.send_file(placeholder('nologo.png')) |
|||
except Exception: |
|||
response = http.send_file(placeholder(imgname + imgext)) |
|||
return response |
|||
|
|||
|
|||
class OdooDebrand(Database): |
|||
def _render_template(self, **d): |
|||
d.setdefault('manage', True) |
|||
d['insecure'] = odoo.tools.config['admin_passwd'] == 'admin' |
|||
d['list_db'] = odoo.tools.config['list_db'] |
|||
d['langs'] = odoo.service.db.exp_list_lang() |
|||
d['countries'] = odoo.service.db.exp_list_countries() |
|||
website_id = request.env['website'].sudo().search([]) |
|||
d['company_name'] = website_id and website_id[0].company_name |
|||
d['favicon_url'] = website_id and website_id[0].favicon_url or '' |
|||
d['company_logo_url'] = website_id and website_id[0].company_logo_url or '' |
|||
# databases list |
|||
d['databases'] = [] |
|||
try: |
|||
d['databases'] = http.db_list() |
|||
except odoo.exceptions.AccessDenied: |
|||
monodb = db_monodb() |
|||
if monodb: |
|||
d['databases'] = [monodb] |
|||
return env.get_template("database_manager_extend.html").render(d) |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import models |
@ -0,0 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
|
|||
from odoo import models, fields, api |
|||
|
|||
|
|||
class OdooDebrand(models.Model): |
|||
_inherit = 'website' |
|||
|
|||
@api.one |
|||
@api.depends('company_favicon') |
|||
def get_favicon(self): |
|||
self.favicon_url = 'data:image/png;base64,' + str(self.company_favicon) |
|||
|
|||
@api.one |
|||
@api.depends('company_logo') |
|||
def get_company_logo(self): |
|||
self.company_logo_url = 'data:image/png;base64,' + str(self.company_logo) |
|||
|
|||
company_logo = fields.Binary("Logo", attachment=True, |
|||
help="This field holds the image used for the Company Logo") |
|||
company_name = fields.Char("Company Name", help="Branding Name") |
|||
company_favicon = fields.Binary("Favicon", attachment=True, |
|||
help="This field holds the image used for as favicon") |
|||
company_website = fields.Char("Company URL") |
|||
favicon_url = fields.Char("Url", compute='get_favicon') |
|||
company_logo_url = fields.Char("Url", compute='get_company_logo') |
|||
|
|||
|
|||
class WebsiteConfig(models.TransientModel): |
|||
_inherit = 'website.config.settings' |
|||
|
|||
company_logo = fields.Binary(related='website_id.company_logo', string="Company Logo", |
|||
help="This field holds the image used for the Company Logo") |
|||
company_name = fields.Char(related='website_id.company_name', string="Company Name") |
|||
company_favicon = fields.Binary(related='website_id.company_favicon', string="Company Favicon", |
|||
help="This field holds the image used for as favicon") |
|||
company_website = fields.Char(related='website_id.company_website') |
|
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 117 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,138 @@ |
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Odoo Debranding</h2> |
|||
<h3 class="oe_slogan">Debrand Odoo Back-end + Front-End</h3> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a></h4> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Configuration</h2> |
|||
<div class="col-md-12"> |
|||
<img class="oe_picture oe_screenshot" src="configurations.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Database Selector Page</h2> |
|||
<div class="col-md-12"> |
|||
<img class="oe_picture oe_screenshot" src="db-selector.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Page Title</h2> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="odoo-title-og.png"/> |
|||
</div> |
|||
<div class="col-md-2" style="top:100px;color:green"> |
|||
<i class="fa fa-hand-o-right fa-2x" aria-hidden="true"></i> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="odoo-title.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Warning</h2> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="warning-og.png"/> |
|||
</div> |
|||
<div class="col-md-2" style="top:50px;color:green"> |
|||
<i class="fa fa-hand-o-right fa-2x" aria-hidden="true"></i> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="warning.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Settings</h2> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="settings-dash-og.png"/> |
|||
</div> |
|||
<div class="col-md-2" style="top:50px;color:green"> |
|||
<i class="fa fa-hand-o-right fa-2x" aria-hidden="true"></i> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="settings-dashboard.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">About</h2> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="about-og.png"/> |
|||
</div> |
|||
<div class="col-md-2" style="top:50px;color:green"> |
|||
<i class="fa fa-hand-o-right fa-2x" aria-hidden="true"></i> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="about.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Powered By</h2> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="powered-og.png"/> |
|||
</div> |
|||
<div class="col-md-2" style="top:50px;color:green"> |
|||
<i class="fa fa-hand-o-right fa-2x" aria-hidden="true"></i> |
|||
</div> |
|||
<div class="col-md-5"> |
|||
<img class="oe_picture oe_screenshot" src="powered.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Website Footer</h2> |
|||
<div class="col-md-12"> |
|||
<img class="oe_picture" src="website_footer-og.png"/> |
|||
</div> |
|||
<span class="" style="padding-left: 50%;color:green"> |
|||
<i class="fa fa-hand-o-down fa-2x" aria-hidden="true"></i> |
|||
</span> |
|||
<div class="col-md-12"> |
|||
<img class="oe_picture" src="footer.png"/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,54 @@ |
|||
odoo.define('odoo-debrand.title', function(require) { |
|||
var core = require('web.core'); |
|||
var utils = require('web.utils'); |
|||
var QWeb = core.qweb; |
|||
var _t = core._t; |
|||
var ajax = require('web.ajax'); |
|||
var Dialog = require('web.Dialog'); |
|||
var WebClient = require('web.AbstractWebClient'); |
|||
var CrashManager = require('web.CrashManager'); |
|||
var Model = require('web.Model'); |
|||
WebClient.include({ |
|||
init: function(parent) { |
|||
this.client_options = {}; |
|||
this._super(parent); |
|||
this.origin = undefined; |
|||
this._current_state = null; |
|||
this.menu_dm = new utils.DropMisordered(); |
|||
this.action_mutex = new utils.Mutex(); |
|||
var self = this; |
|||
new Model("website").call("search_read",[[], ['company_name']]).then(function (res) { |
|||
self.set('title_part', {"zopenerp": res && res[0] && res[0].company_name || ''}); |
|||
}); |
|||
}, |
|||
}); |
|||
CrashManager.include({ |
|||
show_warning: function(error) { |
|||
if (!this.active) { |
|||
return; |
|||
} |
|||
new Dialog(this, { |
|||
size: 'medium', |
|||
title: (_.str.capitalize(error.type) || _t("Warning")), |
|||
subtitle: error.data.title, |
|||
$content: $('<div>').html(QWeb.render('CrashManager.warning', {error: error})) |
|||
}).open(); |
|||
}, |
|||
show_error: function(error) { |
|||
if (!this.active) { |
|||
return; |
|||
} |
|||
new Dialog(this, { |
|||
title: _.str.capitalize(error.type), |
|||
$content: QWeb.render('CrashManager.error', {error: error}) |
|||
}).open(); |
|||
}, |
|||
show_message: function(exception) { |
|||
this.show_error({ |
|||
type: _t("Client Error"), |
|||
message: exception, |
|||
data: {debug: ""} |
|||
}); |
|||
}, |
|||
}); |
|||
}); |
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<templates id="template" xml:space="preserve"> |
|||
<t t-extend="UserMenu"> |
|||
<t t-jquery="ul.dropdown-menu" t-operation="replace"> |
|||
<ul class="dropdown-menu" role="menu"> |
|||
<li class="divider"/> |
|||
<li><a href="#" data-menu="settings">Preferences</a></li> |
|||
<li><a href="#" data-menu="logout">Log out</a></li> |
|||
</ul> |
|||
</t> |
|||
</t> |
|||
<!--<t t-extend="AppSwitcher.Content">--> |
|||
<!--<t t-jquery="div.o_application_switcher_footer" t-operation="replace">--> |
|||
<!--<img src="" width="96px" />--> |
|||
<!--</t>--> |
|||
<!--</t>--> |
|||
<t t-extend="DashboardMain"> |
|||
<t t-jquery=".o_web_settings_dashboard" t-operation="replace"> |
|||
<div class="container-fluid o_web_settings_dashboard"> |
|||
<div class="row"> |
|||
<div class="o_web_settings_dashboard_enterprise"/> |
|||
<div class="col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col"> |
|||
<div class="text-center o_web_settings_dashboard_invitations"></div> |
|||
<div class="col-md-12"> |
|||
<a t-if="debug != true" class="oe_activate_debug_mode pull-right" href="?debug" >Activate the developer mode</a> |
|||
<br t-if="debug != true"/> |
|||
<a t-if="debug != 'assets'" class="oe_activate_debug_mode pull-right" href="?debug=assets" >Activate the developer mode (with assets)</a> |
|||
<br t-if="debug != 'assets'"/> |
|||
<a t-if="debug != false" class="oe_activate_debug_mode pull-right" href="/web" >Deactivate the developer mode</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
<t t-extend="mail.client_action"> |
|||
<t t-jquery=".o_mail_request_permission" t-operation="inner"> |
|||
Your permission is required to <a href="#"> enable desktop notifications</a>. |
|||
</t> |
|||
</t> |
|||
</templates> |
@ -0,0 +1,352 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|||
<title>{{ company_name }}</title> |
|||
<link type="image/x-icon" rel="shortcut icon" href="{{ favicon_url }}"/> |
|||
<link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css"> |
|||
<link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css"> |
|||
<script src="/web/static/lib/jquery/jquery.js" type="text/javascript"></script> |
|||
<script src="/web/static/lib/bootstrap/js/modal.js"></script> |
|||
<script src="/web/static/lib/bootstrap/js/tooltip.js"></script> |
|||
<script src="/web/static/lib/bootstrap/js/dropdown.js"></script> |
|||
<script type="text/javascript"> |
|||
$(function() { |
|||
// Little eye |
|||
$('body').on('mousedown','.o_little_eye',function(ev) { |
|||
$(ev.target).siblings('input').prop('type','text'); |
|||
}); |
|||
$('body').on('mouseup','.o_little_eye',function(ev) { |
|||
$(ev.target).siblings('input').prop('type','password'); |
|||
}); |
|||
// db modal |
|||
$('body').on('click','.o_database_action', function(ev) { |
|||
ev.preventDefault(); |
|||
var db = $(ev.currentTarget).data('db'); |
|||
var target = $(ev.currentTarget).data('target'); |
|||
$(target).find('input[name=name]').val(db); |
|||
$(target).modal(); |
|||
}); |
|||
// close modal on submit |
|||
$('.modal').on('click','input[type="submit"]', function(ev) { |
|||
var modal = $(this).parentsUntil('body', '.modal'); |
|||
if (modal.hasClass('o_database_backup')) { |
|||
$(modal).modal('hide'); |
|||
if (!$('.alert-backup-long').length) { |
|||
$('.list-group').before("<div class='alert alert-info alert-backup-long'>The backup may take some time before being ready</div>"); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
</head> |
|||
|
|||
{% macro master_input() -%} |
|||
<div class="form-group"> |
|||
{% if insecure %} |
|||
<input type="hidden" name="master_pwd" class="form-control" value="admin"/> |
|||
{% else %} |
|||
<label for="master_pwd" class="control-label">Master Password</label> |
|||
<input id="master_pwd" type="password" name="master_pwd" class="form-control" required="required" autofocus="autofocus"/> |
|||
{% endif %} |
|||
</div> |
|||
{%- endmacro %} |
|||
|
|||
{% macro create_form() -%} |
|||
<p>Odoo is up and running! <br /> |
|||
Create a new database by filling out the form, |
|||
you'll be able to install your first app in a minute.</p> |
|||
{{ master_input() }} |
|||
<div class="form-group"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<label for="name" class="control-label">Database Name</label> |
|||
<input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<label for="login" class="control-label">Email</label> |
|||
<input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group has-feedback"> |
|||
<label for="password" class="control-label">Password</label> |
|||
<input id="password" type="password" name="password" class="form-control" required="required" autocomplete="off"/> |
|||
<span class="fa fa-eye o_little_eye form-control-feedback" aria-hidden="true" style="cursor: pointer; pointer-events: auto"></span> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="row"> |
|||
<div class="col-md-6"> |
|||
<label for="lang" class="control-label">Language</label> |
|||
<select id="lang" name="lang" class="form-control" required="required" autocomplete="off"> |
|||
{% for lang in langs %} |
|||
<option {% if lang[0] == "en_US" %}selected="selected" {% endif %}value="{{ lang[0] }}">{{ lang[1] }}</option> |
|||
{% endfor %} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-6"> |
|||
<label for="country" class="control-label">Country</label> |
|||
<select id="country" name="country_code" class="form-control" autocomplete="off"> |
|||
<option value=""></option> |
|||
{% for country in countries %} |
|||
<option value="{{ country[0] }}">{{ country[1] }}</option> |
|||
{% endfor %} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="checkbox"> |
|||
<label> |
|||
<input name="demo" type="checkbox" class="pull-right" value="1"> |
|||
<span>Load demonstration data</span> |
|||
<span class="text-muted"> (Check this box to evaluate Odoo)</span> |
|||
</label> |
|||
</div> |
|||
</div> |
|||
{%- endmacro %} |
|||
|
|||
<body class="container"> |
|||
<!-- Database List --> |
|||
<div class="row"> |
|||
<div class="col-md-6 col-md-offset-3 o_database_list"> |
|||
<div class="text-center"> |
|||
<img src="{{ company_logo_url }}" class="img-responsive center-block"/> |
|||
</div> |
|||
{% if insecure and databases %} |
|||
<div class="alert alert-warning"> |
|||
<!--Add your company name--> |
|||
Warning, {{ company_name }} database manager is not protected. |
|||
Please <a href="#" data-toggle="modal" data-target=".o_database_master">set a master password</a> |
|||
to secure it. |
|||
</div> |
|||
{% endif %} |
|||
{% if error %} |
|||
<div class="alert alert-danger">{{ error }}</div> |
|||
{% endif %} |
|||
{% if databases %} |
|||
<div class="list-group"> |
|||
{% for db in databases %} |
|||
<a href="/web?db={{ db }}" class="list-group-item"> |
|||
{{ db }} |
|||
{% if manage %} |
|||
<div class="text-right pull-right"> |
|||
<span data-db="{{ db }}" data-target=".o_database_backup" class="o_database_action btn-link"><i class="fa fa-floppy-o fa-fw"></i> Backup</span> |
|||
<span data-db="{{ db }}" data-target=".o_database_duplicate" class="o_database_action btn-link"><i class="fa fa-files-o fa-fw"></i> Duplicate</span> |
|||
<span data-db="{{ db }}" data-target=".o_database_delete" class="o_database_action btn-link"><i class="fa fa-trash-o fa-fw"></i> Delete</span> |
|||
</div> |
|||
{% endif %} |
|||
</a> |
|||
{% endfor %} |
|||
</div> |
|||
{% if manage %} |
|||
<div class="text-left"> |
|||
<button type="button" data-toggle="modal" data-target=".o_database_create" class="btn btn-sm btn-primary"> |
|||
Create Database |
|||
</button> |
|||
<button type="button" data-toggle="modal" data-target=".o_database_restore" class="btn btn-sm btn-primary"> |
|||
Restore Database |
|||
</button> |
|||
<button type="button" data-toggle="modal" data-target=".o_database_master" class="btn btn-sm btn-primary"> |
|||
Set Master Password |
|||
</button> |
|||
</div> |
|||
{% else %} |
|||
<div class="text-center"> |
|||
<a href="/web/database/manager">Manage databases</a> |
|||
</div> |
|||
{% endif %} |
|||
{% else %} |
|||
<form role="form" action="/web/database/create" method="post"> |
|||
{{ create_form() }} |
|||
<input type="submit" value="Create database" class="btn btn-primary pull-left"/> |
|||
</form> |
|||
<a role="button" data-toggle="modal" data-target=".o_database_restore" class="btn btn-link"> |
|||
or restore a database |
|||
</a> |
|||
{% endif %} |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- Create --> |
|||
<div class="modal fade o_database_create" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<form role="form" action="/web/database/create" method="post"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Create Database</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
{{ create_form() }} |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Continue" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- Restore --> |
|||
<div class="modal fade o_database_restore" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Restore Database</h4> |
|||
</div> |
|||
<form id="form_restore_db" role="form" action="/web/database/restore" method="post" enctype="multipart/form-data"> |
|||
<div class="modal-body"> |
|||
{{ master_input() }} |
|||
<div class="form-group"> |
|||
<label for="backup_file" class="control-label">File</label> |
|||
<input id="backup_file" type="file" name="backup_file" class="required"/> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="name" class="control-label">Database Name</label> |
|||
<input id="name" type="text" name="name" class="form-control" required="required"/> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="copy">This database might have been moved or copied.</label> |
|||
<p class="help-block">In order to avoid conflicts between databases, {{ company_name }} needs to know if this database was moved or copied. |
|||
If you don't know, answer "This database is a copy".</p> |
|||
<div class="radio"> |
|||
<label> |
|||
<input name="copy" type="radio" class="pull-right" value="true" checked="1"> |
|||
This database is a copy |
|||
</label> |
|||
</div> |
|||
<div class="radio"> |
|||
<label> |
|||
<input name="copy" type="radio" class="pull-right" value="false"> |
|||
This database was moved |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Continue" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<!-- Master password --> |
|||
<div class="modal fade o_database_master" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Set Master Password</h4> |
|||
</div> |
|||
<form id="form_change_pwd" role="form" action="/web/database/change_password" method="post"> |
|||
<div class="modal-body"> |
|||
<p>The master password is required to create, delete, dump or restore databases.</p> |
|||
{{ master_input() }} |
|||
<div class="form-group has-feedback"> |
|||
<label for="master_pwd_new" class="control-label">New Master Password</label> |
|||
<input id="master_pwd_new" type="password" name="master_pwd_new" class="form-control" required="required" autocomplete="off"/> |
|||
<span class="fa fa-eye o_little_eye form-control-feedback" aria-hidden="true" style="cursor: pointer; pointer-events: auto"></span> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Continue" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<!-- Duplicate DB --> |
|||
<div class="modal fade o_database_duplicate" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Duplicate Database</h4> |
|||
</div> |
|||
<form id="form-duplicate-db" role="form" action="/web/database/duplicate" method="post"> |
|||
<div class="modal-body"> |
|||
{{ master_input() }} |
|||
<div class="form-group"> |
|||
<label for="name" class="control-label">Database Name</label> |
|||
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="new_name" class="control-label">New Name</label> |
|||
<input id="new_name" type="text" name="new_name" class="form-control" required="required"/> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Continue" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- Drop DB --> |
|||
<div class="modal fade o_database_delete" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Delete Database</h4> |
|||
</div> |
|||
<form id="form_drop_db" role="form" action="/web/database/drop" method="post"> |
|||
<div class="modal-body"> |
|||
{{ master_input() }} |
|||
<div class="form-group"> |
|||
<label for="name" class="control-label">Database</label> |
|||
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Delete" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- Backup DB --> |
|||
<div class="modal fade o_database_backup" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|||
<h4 class="modal-title">Backup Database</h4> |
|||
</div> |
|||
<form id="form_backup_db" role="form" action="/web/database/backup" method="post"> |
|||
<div class="modal-body"> |
|||
{{ master_input() }} |
|||
<div class="form-group"> |
|||
<label for="name" class="control-label">Database Name</label> |
|||
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="backup_format" class="control-label">Backup Format</label> |
|||
<select id="backup_format" name="backup_format" id="backup_format" class="form-control" required="required"> |
|||
<option value="zip">zip (includes filestore)</option> |
|||
<option value="dump">pg_dump custom format (without filestore)</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="submit" value="Backup" class="btn btn-primary pull-right"/> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,22 @@ |
|||
<openerp> |
|||
<data> |
|||
<!-- <template id="listing"> --> |
|||
<!-- <ul> --> |
|||
<!-- <li t-foreach="objects" t-as="object"> --> |
|||
<!-- <a t-attf-href="#{ root }/objects/#{ object.id }"> --> |
|||
<!-- <t t-esc="object.display_name"/> --> |
|||
<!-- </a> --> |
|||
<!-- </li> --> |
|||
<!-- </ul> --> |
|||
<!-- </template> --> |
|||
<!-- <template id="object"> --> |
|||
<!-- <h1><t t-esc="object.display_name"/></h1> --> |
|||
<!-- <dl> --> |
|||
<!-- <t t-foreach="object._fields" t-as="field"> --> |
|||
<!-- <dt><t t-esc="field"/></dt> --> |
|||
<!-- <dd><t t-esc="object[field]"/></dd> --> |
|||
<!-- </t> --> |
|||
<!-- </dl> --> |
|||
<!-- </template> --> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,146 @@ |
|||
<openerp> |
|||
<data> |
|||
<record id="debrand_config" model="ir.ui.view"> |
|||
<field name="name">Debranding Configuration</field> |
|||
<field name="model">website.config.settings</field> |
|||
<field name="inherit_id" ref="website.view_website_config_settings"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//group[@name='social']" position="after"> |
|||
<group name="debrand_config" string="Debranding Configurations"> |
|||
<label for="company_logo" string="Company Logo"/> |
|||
<div> |
|||
<div id="company_logo" class="oe_inline"> |
|||
<field name="company_logo" |
|||
widget="image" |
|||
class="oe_avatar" |
|||
options="{'preview_image': 'image_medium', 'size': [130, 130]}" |
|||
/> |
|||
</div> |
|||
</div> |
|||
<label for="company_favicon" string="Company Favicon"/> |
|||
<div> |
|||
<div id="company_favicon" class="oe_inline"> |
|||
<field name="company_favicon" |
|||
widget="image" |
|||
class="oe_avatar" |
|||
options="{'preview_image': 'image_small', 'size': [30, 30]}"/> |
|||
</div> |
|||
</div> |
|||
<label for="company_name" string="Company Name"/> |
|||
<div> |
|||
<div id="company_name" class="oe_inline"> |
|||
<field name="company_name"/> |
|||
</div> |
|||
</div> |
|||
<label for="company_website" string="Company Website"/> |
|||
<div> |
|||
<div id="company_website" class="oe_inline"> |
|||
<field name="company_website"/> |
|||
</div> |
|||
</div> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<template id="login_layout" inherit_id="web.login_layout"> |
|||
<xpath expr="//div[@class='text-center']" position="replace"> |
|||
<div class="text-center" t-if="not disable_footer"> |
|||
<t t-if="not disable_database_manager"> |
|||
<a class="" href="/web/database/manager">Manage Databases</a> | |
|||
</t> |
|||
<a t-att-href="request.env['website'].sudo().search([])[0].company_name or ''" target="_blank"> |
|||
<span t-esc="request.env['website'].sudo().search([])[0].company_name or ''"/></a> |
|||
</div> |
|||
|
|||
</xpath> |
|||
</template> |
|||
<template id="login_layout_secondary" inherit_id="web.menu_secondary"> |
|||
<xpath expr="//div[@class='o_sub_menu_footer']" position="replace"> |
|||
<div class="o_sub_menu_footer"> |
|||
Powered by <a t-att-href="request.env['website'].sudo().search([])[0].company_website or ''" target="_blank"> |
|||
<span t-esc="request.env['website'].sudo().search([])[0].company_name or ''"/></a> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
<template id="login_layout_im_livechat" inherit_id="im_livechat.support_page"> |
|||
<xpath expr="//body" position="replace"> |
|||
<body> |
|||
<div class="main" style="opacity: 1;"> |
|||
<h1 class="channel_name"><t t-esc="channel.name"/></h1> |
|||
<div>Website Live Chat Powered by <strong><t t-esc="request.env['website'].sudo().search([])[0].company_name or '"/></strong></div> |
|||
</div> |
|||
</body> |
|||
</xpath> |
|||
</template> |
|||
<template id="login_layout" inherit_id="mail.message_user_assigned"> |
|||
<xpath expr="//p[last()]" position="replace"> |
|||
<p style="color:#9E588B;">Powered by <a t-att-href="request.env['website'].sudo().search([])[0].company_website or ''"> |
|||
<t t-esc="request.env['website'].sudo().search([])[0].company_name or ''"/></a>.</p> |
|||
</xpath> |
|||
</template> |
|||
<template id="website.layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright"> |
|||
<xpath expr="//footer" position="inside"> |
|||
<div class="container mt16 mb8"> |
|||
<div class="pull-right" t-if="not editable"> |
|||
Powered by <a class="label label-danger" t-att-href="request.env['website'].sudo().search([])[0].company_website"> |
|||
<t t-esc="request.env['website'].sudo().search([])[0].company_name"/> </a>. |
|||
</div> |
|||
<div class="pull-left text-muted"> |
|||
Copyright &copy; <span t-esc="request.env['website'].sudo().search([])[0].company_name"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
<template id="footer_extend" inherit_id="website.footer_custom"> |
|||
<xpath position="replace" expr="//h2"/> |
|||
</template> |
|||
<!--put teh company logo or the fav icons path here in href--> |
|||
<template id="web_layout_extend" inherit_id="web.layout"> |
|||
<xpath expr="//title" position="replace"> |
|||
<title><t t-esc="request.env['website'].sudo().search([])[0].company_name or ''"/></title> |
|||
</xpath> |
|||
<xpath position="replace" expr="//link[@rel='shortcut icon']"><t> |
|||
<link type="image/x-icon" rel="shortcut icon" t-att-href="request.env['website'].sudo().search([])[0].favicon_url or ''"/></t> |
|||
</xpath> |
|||
</template> |
|||
|
|||
<template id="debranding_title" name="Debranding title JS" |
|||
inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<script type="text/javascript" src="/odoo-debrand/static/src/js/title.js"/> |
|||
</xpath> |
|||
</template> |
|||
<!--Code for Enterprise Edition--> |
|||
<!--<template id="remove_bbotstrap_fav" inherit_id="web_enterprise.webclient_bootstrap">--> |
|||
<!--<xpath expr="//link[@rel='icon']" position="replace">--> |
|||
<!--<link rel="icon" sizes="192x192" href=""/>--> |
|||
<!--</xpath>--> |
|||
<!--<xpath expr="//link[@rel='apple-touch-icon']" position="replace">--> |
|||
<!--<link rel="apple-touch-icon" sizes="152x152" href=""/>--> |
|||
<!--</xpath>--> |
|||
<!--</template>--> |
|||
<template inherit_id="web.login_layout" id="login_layout_extend"> |
|||
<xpath position="replace" expr="//div[@class='row']"> |
|||
<div class="row"> |
|||
<div class="col-md-6 col-md-offset-3 o_database_list"> |
|||
<div class="text-center"> |
|||
<img t-attf-src="request.env['website'].sudo().search([])[0].favicon_url or ''"/> |
|||
</div> |
|||
<t t-raw="0"/> |
|||
<div class="text-center" t-if="not disable_footer"> |
|||
<t t-if="not disable_database_manager"> |
|||
<a class="" href="/web/database/manager">Manage Databases</a> | |
|||
</t> |
|||
<t> |
|||
<a t-att-href="request.env['website'].sudo().search([])[0].company_website" target="_blank">Powered by |
|||
<span t-esc="request.env['website'].sudo().search([])[0].company_name"/></a> |
|||
</t> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</openerp> |