Browse Source

[IMP] Improved 'odoo-debrand'

pull/134/merge
Ajmalcybrosys 6 years ago
parent
commit
7f24fed187
  1. 4
      odoo-debrand/README.rst
  2. 11
      odoo-debrand/__manifest__.py
  3. 1
      odoo-debrand/controllers/controllers.py
  4. 4
      odoo-debrand/models/models.py
  5. BIN
      odoo-debrand/static/description/images/debranding-03.png
  6. 36
      odoo-debrand/static/description/index.html
  7. 69
      odoo-debrand/static/src/js/title.js
  8. 3
      odoo-debrand/static/src/xml/base.xml
  9. 193
      odoo-debrand/views/database_manager_extend.html
  10. 11
      odoo-debrand/views/res_config_views.xml
  11. 5
      odoo-debrand/views/views.xml

4
odoo-debrand/README.rst

@ -10,11 +10,9 @@ Debranding of odoo with the given configurations under Website Admin -> Debrandi
Will replace: Will replace:
- Page Title - Page Title
- Odoo from Popups - Login Page Modification
- User Drop down Odoo links - User Drop down Odoo links
- Website Title
- POS Odoo logo replaced by company logo - POS Odoo logo replaced by company logo
- Odoo label from Dialogues
- Odoo Database Selector Logo, Labels - Odoo Database Selector Logo, Labels
Installation Installation

11
odoo-debrand/__manifest__.py

@ -22,17 +22,18 @@
{ {
'name': "Odoo Debranding", 'name': "Odoo Debranding",
'version': "13.0.1.0.0", 'version': "13.0.1.1.1",
'summary': """Debrand Odoo""", 'summary': """Odoo Backend and Front end Debranding""",
'description': """Debrand Odoo,Debranding""", 'description': """Debrand Odoo,Debranding, odoo13""",
'author': "Cybrosys Techno Solutions", 'author': "Cybrosys Techno Solutions",
'company': "Cybrosys Techno Solutions", 'company': "Cybrosys Techno Solutions",
'maintainer': "Cybrosys Techno Solutions", 'maintainer': "Cybrosys Techno Solutions",
'website': "https://cybrosys.com/", 'website': "https://cybrosys.com/",
'category': 'Tools', 'category': 'Tools',
'depends': ['base', 'im_livechat', 'website'], 'depends': ['website', 'base_setup'],
'data': [ 'data': [
'views/views.xml' 'views/views.xml',
'views/res_config_views.xml'
], ],
'qweb': ["static/src/xml/base.xml"], 'qweb': ["static/src/xml/base.xml"],
'images': ['static/description/banner.gif'], 'images': ['static/description/banner.gif'],

1
odoo-debrand/controllers/controllers.py

@ -104,6 +104,7 @@ class BinaryCustom(Binary):
imgext = '.' + mimetype.split('/')[1] imgext = '.' + mimetype.split('/')[1]
if imgext == '.svg+xml': if imgext == '.svg+xml':
imgext = '.svg' imgext = '.svg'
response = http.send_file(image_data, response = http.send_file(image_data,
filename=imgname + imgext, filename=imgname + imgext,
mimetype=mimetype, mimetype=mimetype,

4
odoo-debrand/models/models.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
############################################################################# #############################################################################
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.
@ -24,6 +25,9 @@ from odoo import models, fields, api, tools
class OdooDebrand(models.Model): class OdooDebrand(models.Model):
"""
Fields to access from the database manager.
"""
_inherit = "website" _inherit = "website"
def get_company_logo(self): def get_company_logo(self):

BIN
odoo-debrand/static/description/images/debranding-03.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 100 KiB

36
odoo-debrand/static/description/index.html

@ -5,16 +5,16 @@
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px"> <div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
<div style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;"> <div style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">ODOO DEBRANDING</h1> <h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">ODOO DEBRANDING</h1>
<h3 style="font-size: 21px;margin-top: 8px;position: relative;">Debrand Odoo Back-end + Front-End .</h3> <h3 style="font-size: 21px;margin-top: 8px;position: relative;">Debrand Odoo Back-End + Front-End .</h3>
</div> </div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2> <h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; "> <ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Modify database selector page</li> <li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Modify database selector page</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Modify login page </li> <li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Modify login page </li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Remove Odoo's default favicon</li> <li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Remove 'About' in Configuration</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Updated "About" list</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Updated warning messages</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Page title modification</li> <li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Page title modification</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Updated User dropdown List</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Company Logo In POS</li>
</ul> </ul>
</div> </div>
@ -54,7 +54,7 @@
<h2 style="font-weight: 600;text-align: center;width: 100%;">Overview</h2> <h2 style="font-weight: 600;text-align: center;width: 100%;">Overview</h2>
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;"> <hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<h3 class="oe_slogan" style="text-align: center;font-size: 19px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 31px;font-weight: 400;letter-spacing: .5px;margin-bottom: 21px;"> <h3 class="oe_slogan" style="text-align: center;font-size: 19px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 31px;font-weight: 400;letter-spacing: .5px;margin-bottom: 21px;">
Want to debrand your company website? Odoo Debranding module developed by Cybrosys Technologies helps you to change the aesthetic look of Odoo software via customizing them with Logo and other branding changes. The module helps you to change almost every area of Odoo visuals, delivering a brand new customized website. </div> Odoo Debranding module helps you to change the aesthetic look of Odoo software via customizing. The module helps you to remove all odoo reference from Front end and Back end. </div>
<div class="px-3 pt-1 tab-pane fade " id="pills-home1" role="tabpanel" aria-labelledby=" <div class="px-3 pt-1 tab-pane fade " id="pills-home1" role="tabpanel" aria-labelledby="
pills-home-tab"> pills-home-tab">
@ -70,14 +70,15 @@
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Modify database selector page. </li> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Modify database selector page. </li>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;"> <li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Modify login page. </li> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Modify login page (Remove 'Powered by odoo'). </li>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;"> <li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Remove Odoo's default favicon. </li> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Page title modification (Remove Odoo from Title)</li>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;"> <li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Updated warning messages. </li> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Updated User dropdown List (Remove 'Accounts and Documentation')</li>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;"> <li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Page title modification. </li> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Remove About from Configuration menu.</li>
</ul> </ul>
</div> </div>
@ -95,14 +96,6 @@
<div id="demo" class="row carousel slide mb32" data-ride="carousel"> <div id="demo" class="row carousel slide mb32" data-ride="carousel">
<div class="carousel-inner"> <div class="carousel-inner">
<div class="carousel-item active" style="min-height: 0px;"> <div class="carousel-item active" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> As you see in the settings option you need to set up the Website name & favicon then only the change will be affected in the title. Also you need to setup the company logo from the settings page to change the default logo..</h3>
<div style=""> <img class="img img-responsive center-block" style="border-top-left-radius: 10px;border-top-right-radius: 10px;" src="images/debranding-01.png"> </div>
</div>
</div>
<div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;"> <div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Company logo in login page. </h3> <h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Company logo in login page. </h3>
@ -121,15 +114,6 @@
</div> </div>
<div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px; "> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Updated the Odoo title in the messages.</h3>
<div style=""> <img class="img img-responsive center-block" style="border-top-left-radius: 10px;border-top-right-radius: 10px;" src="images/debranding-04.png"> </div>
</div>
</div>
<div class="carousel-item" style="min-height: 0px;"> <div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;"> <div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">

69
odoo-debrand/static/src/js/title.js

@ -1,4 +1,4 @@
odoo.define('odoo-debrand-11.title', function(require) { odoo.define('odoo-debrand.title', function(require) {
"use strict"; "use strict";
var core = require('web.core'); var core = require('web.core');
@ -26,53 +26,30 @@ var map_title ={
access_denied: _lt('Access Denied'), access_denied: _lt('Access Denied'),
}; };
var myWebClient = WebClient.include({ var myWebClient = WebClient.include({
init: function (parent) {
start: function () {
this._super(); this._super();
var domain = session.user_context.allowed_company_ids;
var obj = this; var obj = this;
this._rpc({ this._rpc({
fields: ['name',], fields: ['name','id',],
domain: [], domain: [['id', 'in', domain]],
model: 'website', model: 'res.company',
method: 'search_read', method: 'search_read',
limit: 1,
context: session.user_context,
}) })
.then(function (result) { .then(function (result) {
obj.set('title_part', {"zopenerp": result[0].name}); obj.set('title_part', {"zopenerp": result[0].name}); // Replacing the name 'Oodo' to selected company name near favicon
});
},
start: function () {
this._super();
this._rpc({
fields: ['name',],
domain: [],
model: 'website',
method: 'search_read',
limit: 1,
context: session.user_context,
})
.then(function(result){
$("link[type='image/x-icon']").attr('href', '/web/image/website/'+result[0].id+'/favicon');
}); });
}, },
}); });
var ExceptionHandler = { var ExceptionHandler = {
/**
* @param parent The parent.
* @param error The error object as returned by the JSON-RPC implementation.
*/
init: function(parent, error) {}, init: function(parent, error) {},
/**
* Called to inform to display the widget, if necessary. A typical way would be to implement
* this interface in a class extending instance.web.Dialog and simply display the dialog in this
* method.
*/
display: function() {}, display: function() {},
}; };
var RedirectWarningHandler = Dialog.extend(ExceptionHandler, { var RedirectWarningHandler = Widget.extend(ExceptionHandler, { // Rewriting the exception handler
init: function(parent, error) { init: function(parent, error) {
this._super(parent); this._super(parent);
this.error = error; this.error = error;
@ -80,32 +57,36 @@ var RedirectWarningHandler = Dialog.extend(ExceptionHandler, {
display: function() { display: function() {
var self = this; var self = this;
var error = this.error; var error = this.error;
error.data.message = error.data.arguments[0];
new Dialog(this, { new WarningDialog(this, {
size: 'medium', title: _.str.capitalize(error.type) || _t("Warning"), // Replacing 'Odoo Warning' to 'Warning'
title: _.str.capitalize(error.type) || _t("Warning"),
buttons: [ buttons: [
{text: error.data.arguments[2], classes : "btn-primary", click: function() { {text: error.data.arguments[2], classes : "btn-primary", click: function() {
window.location.href = '#action='+error.data.arguments[1]; $.bbq.pushState({
'action': error.data.arguments[1],
'cids': $.bbq.getState().cids,
}, 2);
self.destroy(); self.destroy();
location.reload();
}}, }},
{text: _t("Cancel"), click: function() { self.destroy(); }, close: true} {text: _t("Cancel"), click: function() { self.destroy(); }, close: true}
], ]
$content: QWeb.render('CrashManager.warning', {error: error}), }, {
message: error.data.arguments[0],
}).open(); }).open();
} }
}); });
core.crash_registry.add('odoo.exceptions.RedirectWarning', RedirectWarningHandler); core.crash_registry.add('odoo.exceptions.RedirectWarning', RedirectWarningHandler);
function session_expired(cm) { function session_expired(cm) {
return { return {
display: function () { display: function () { // Replace 'Odoo session expired' to 'Session Expired'
cm.show_warning({type: _t("Session Expired"), data: {message: _t("Your Odoo session expired. Please refresh the current web page.")}}); cm.show_warning({type: _t("Session Expired"), data: {message: _t("Your Session expired. Please refresh the current web page.")}});
} }
}; };
} }
core.crash_registry.add('odoo.http.SessionExpiredException', session_expired); core.crash_registry.add('odoo.http.SessionExpiredException', session_expired);
}); });

3
odoo-debrand/static/src/xml/base.xml

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<!-- Remove 'Documentation', 'Support', etc menu items -->
<t t-extend="UserMenu"> <t t-extend="UserMenu">
<t t-jquery="div.dropdown-menu.dropdown-menu-right" <t t-jquery="div.dropdown-menu.dropdown-menu-right"
t-operation="replace"> t-operation="replace">
@ -17,6 +19,7 @@
Your permission is required to <a href="#"> enable desktop notifications</a>. Your permission is required to <a href="#"> enable desktop notifications</a>.
</t> </t>
</t> </t>
<!-- Change logo in POS to company logo. -->
<t t-extend="Chrome"> <t t-extend="Chrome">
<t t-jquery="div.pos-branding" <t t-jquery="div.pos-branding"
t-operation="replace"> t-operation="replace">

193
odoo-debrand/views/database_manager_extend.html

@ -1,5 +1,6 @@
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>{{ website_name }}</title> <title>{{ website_name }}</title>
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon">
@ -49,60 +50,65 @@
} }
}); });
}); });
</script> </script>
</head> </head>
{% macro master_input() -%} {% macro master_input() -%}
<div class="form-group"> <div class="form-group">
{% if insecure %} {% if insecure %}
<input type="hidden" name="master_pwd" class="form-control" value="admin"/> <input type="hidden" name="master_pwd" class="form-control" value="admin"/>
{% else %} {% else %}
<label for="master_pwd" class="col-form-label">Master Password</label> <label for="master_pwd" class="col-form-label">Master Password</label>
<input id="master_pwd" type="password" name="master_pwd" class="form-control" required="required" autofocus="autofocus"/> <input id="master_pwd" type="password" name="master_pwd" class="form-control" required="required"
autofocus="autofocus"/>
{% endif %} {% endif %}
</div> </div>
{%- endmacro %} {%- endmacro %}
{% macro create_form() -%} {% macro create_form() -%}
{{ master_input() }} {{ master_input() }}
<div class="form-group row"> <div class="form-group row">
<label for="name" class="col-md-4 col-form-label">Database Name</label> <label for="name" class="col-md-4 col-form-label">Database Name</label>
<div class="col-md-8"> <div class="col-md-8">
<input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off" pattern="{{ pattern }}" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/> <input id="name" type="text" name="name" class="form-control" required="required" autocomplete="off"
</div> pattern="{{ pattern }}" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/>
</div> </div>
<div class="form-group row"> </div>
<div class="form-group row">
<label for="login" class="col-md-4 col-form-label">Email</label> <label for="login" class="col-md-4 col-form-label">Email</label>
<div class="col-md-8"> <div class="col-md-8">
<input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/> <input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="password" class="col-md-4 col-form-label">Password</label> <label for="password" class="col-md-4 col-form-label">Password</label>
<div class="col-md-8 input-group"> <div class="col-md-8 input-group">
<input id="password" type="password" name="password" class="form-control" required="required" autocomplete="off"/> <input id="password" type="password" name="password" class="form-control" required="required"
autocomplete="off"/>
<div class="input-group-append"> <div class="input-group-append">
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span> <span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="phone" class="col-md-4 col-form-label">Phone number</label> <label for="phone" class="col-md-4 col-form-label">Phone number</label>
<div class="col-md-8 input-group"> <div class="col-md-8 input-group">
<input id="phone" type="tel" name="phone" class="form-control" autocomplete="off"/> <input id="phone" type="tel" name="phone" class="form-control" autocomplete="off"/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="lang" class="col-md-4 col-form-label">Language</label> <label for="lang" class="col-md-4 col-form-label">Language</label>
<div class="col-md-8"> <div class="col-md-8">
<select id="lang" name="lang" class="form-control" required="required" autocomplete="off"> <select id="lang" name="lang" class="form-control" required="required" autocomplete="off">
{% for lang in langs %} {% for lang in langs %}
<option {% if lang[0] == "en_US" %}selected="selected" {% endif %}value="{{ lang[0] }}">{{ lang[1] }}</option> <option {% if lang[0]==
"en_US" %}selected="selected" {% endif %}value="{{ lang[0] }}">{{ lang[1] }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="country" class="col-md-4 col-form-label ">Country</label> <label for="country" class="col-md-4 col-form-label ">Country</label>
<div class="col-md-8"> <div class="col-md-8">
<select id="country" name="country_code" class="form-control" autocomplete="off"> <select id="country" name="country_code" class="form-control" autocomplete="off">
@ -112,28 +118,30 @@
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="demo" class="col-md-4 col-form-label">Demo data</label> <label for="demo" class="col-md-4 col-form-label">Demo data</label>
<div class="col-md-8"> <div class="col-md-8">
<input type="checkbox" id="load_demo_checkbox" class="form-control-sm" name="demo" value="1"> <input type="checkbox" id="load_demo_checkbox" class="form-control-sm" name="demo" value="1">
</div> </div>
</div> </div>
{%- endmacro %} {%- endmacro %}
<body> <body>
<div class="container"> <div class="container">
<!-- Database List --> <!-- Database List -->
<div class="row"> <div class="row">
<div class="col-lg-6 offset-lg-3 o_database_list"> <div class="col-lg-6 offset-lg-3 o_database_list">
<img src="{{ company_logo_url }}" class="img-fluid d-block mx-auto"/> <img src="{{ company_logo_url }}" class="img-fluid d-block mx-auto"/>
<!--<img src="/web/static/src/img/logo2.png" class="img-fluid d-block mx-auto"/>--> <!--<img src="/web/static/src/img/logo2.png" class="img-fluid d-block mx-auto"/>-->
{% if not list_db %} {% if not list_db %}
<div class="alert alert-danger text-center">The database manager has been disabled by the administrator</div> <div class="alert alert-danger text-center">The database manager has been disabled by the administrator
</div>
{% elif insecure and databases %} {% elif insecure and databases %}
<div class="alert alert-warning"> <div class="alert alert-warning ">
Warning, {{ company_name }} database manager is not protected.<br/> Warning, {{ company_name }} database manager is not protected.<br/>
Please <a href="#" data-toggle="modal" data-target=".o_database_master">set a master password</a> to secure it. Please <a href="#" data-toggle="modal" data-target=".o_database_master">set a master password</a> to
secure it.
</div> </div>
{% endif %} {% endif %}
{% if error %} {% if error %}
@ -145,19 +153,23 @@
<div class="list-group-item d-flex align-items-center"> <div class="list-group-item d-flex align-items-center">
<a href="/web?db={{ db }}" class="d-block flex-grow-1"> <a href="/web?db={{ db }}" class="d-block flex-grow-1">
{% if db in incompatible_databases %} {% if db in incompatible_databases %}
<i class="icon fa fa-warning float-right text-warning" title="This database may not be compatible"></i> <i class="icon fa fa-warning float-right text-warning"
title="This database may not be compatible"></i>
{% endif %} {% endif %}
{{ db }} {{ db }}
</a> </a>
{% if manage %} {% if manage %}
<div class="btn-group btn-group-sm float-right"> <div class="btn-group btn-group-sm float-right">
<button type="button" data-db="{{ db }}" data-target=".o_database_backup" class="o_database_action btn btn-primary"> <button type="button" data-db="{{ db }}" data-target=".o_database_backup"
class="o_database_action btn btn-primary">
<i class="fa fa-floppy-o fa-fw"></i> Backup <i class="fa fa-floppy-o fa-fw"></i> Backup
</button> </button>
<button type="button" data-db="{{ db }}" data-target=".o_database_duplicate" class="o_database_action btn btn-secondary"> <button type="button" data-db="{{ db }}" data-target=".o_database_duplicate"
class="o_database_action btn btn-secondary">
<i class="fa fa-files-o fa-fw"></i> Duplicate <i class="fa fa-files-o fa-fw"></i> Duplicate
</button> </button>
<button type="button" data-db="{{ db }}" data-target=".o_database_delete" class="o_database_action btn btn-danger"> <button type="button" data-db="{{ db }}" data-target=".o_database_delete"
class="o_database_action btn btn-danger">
<i class="fa fa-trash-o fa-fw"></i> Delete <i class="fa fa-trash-o fa-fw"></i> Delete
</button> </button>
</div> </div>
@ -167,9 +179,15 @@
</div> </div>
{% if manage %} {% if manage %}
<div class="d-flex mt-2"> <div class="d-flex mt-2">
<button type="button" data-toggle="modal" data-target=".o_database_create" class="btn btn-primary flex-grow-1">Create Database</button> <button type="button" data-toggle="modal" data-target=".o_database_create"
<button type="button" data-toggle="modal" data-target=".o_database_restore" class="btn btn-primary flex-grow-1 ml-2">Restore Database</button> class="btn btn-primary flex-grow-1">Create Database
<button type="button" data-toggle="modal" data-target=".o_database_master" class="btn btn-primary flex-grow-1 ml-2">Set Master Password</button> </button>
<button type="button" data-toggle="modal" data-target=".o_database_restore"
class="btn btn-primary flex-grow-1 ml-2">Restore Database
</button>
<button type="button" data-toggle="modal" data-target=".o_database_master"
class="btn btn-primary flex-grow-1 ml-2">Set Master Password
</button>
</div> </div>
{% else %} {% else %}
<div class="text-center mt-2"> <div class="text-center mt-2">
@ -181,20 +199,21 @@
{{ create_form() }} {{ create_form() }}
<input type="submit" value="Create database" class="btn btn-primary float-left"/> <input type="submit" value="Create database" class="btn btn-primary float-left"/>
</form> </form>
<a role="button" data-toggle="modal" data-target=".o_database_restore" class="btn btn-link">or restore a database</a> <a role="button" data-toggle="modal" data-target=".o_database_restore" class="btn btn-link">or restore a
database</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
<!-- Create -->
<!-- Create --> <div class="modal fade o_database_create" role="dialog">
<div class="modal fade o_database_create" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<form role="form" action="/web/database/create" method="post"> <form role="form" action="/web/database/create" method="post">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Create Database</h4> <h4 class="modal-title">Create Database</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
{{ create_form() }} {{ create_form() }}
@ -205,17 +224,19 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Restore --> <!-- Restore -->
<div class="modal fade o_database_restore" role="dialog"> <div class="modal fade o_database_restore" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Restore Database</h4> <h4 class="modal-title">Restore Database</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form id="form_restore_db" role="form" action="/web/database/restore" method="post" enctype="multipart/form-data"> <form id="form_restore_db" role="form" action="/web/database/restore" method="post"
enctype="multipart/form-data">
<div class="modal-body"> <div class="modal-body">
{{ master_input() }} {{ master_input() }}
<div class="form-group"> <div class="form-group">
@ -224,20 +245,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Database Name</label> <label for="name" class="col-form-label">Database Name</label>
<input id="name" type="text" name="name" class="form-control" required="required" pattern="{{ pattern }}" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/> <input id="name" type="text" name="name" class="form-control" required="required"
pattern="{{ pattern }}"
title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="copy">This database might have been moved or copied.</label> <label for="copy">This database might have been moved or copied.</label>
<p class="form-text"> <p class="form-text">
In order to avoid conflicts between databases, needs to know if this database was moved or copied.<br/> In order to avoid conflicts between databases, needs to know if this database was moved or
copied.<br/>
If you don't know, answer "This database is a copy". If you don't know, answer "This database is a copy".
</p> </p>
<div class="custom-control custom-radio"> <div class="custom-control custom-radio">
<input id="radio_copy_true" name="copy" type="radio" class="custom-control-input" value="true" checked="1"> <input id="radio_copy_true" name="copy" type="radio" class="custom-control-input"
value="true" checked="1">
<label for="radio_copy_true" class="custom-control-label">This database is a copy</label> <label for="radio_copy_true" class="custom-control-label">This database is a copy</label>
</div> </div>
<div class="custom-control custom-radio"> <div class="custom-control custom-radio">
<input id="radio_copy_false" name="copy" type="radio" class="custom-control-input" value="false"> <input id="radio_copy_false" name="copy" type="radio" class="custom-control-input"
value="false">
<label for="radio_copy_false" class="custom-control-label">This database was moved</label> <label for="radio_copy_false" class="custom-control-label">This database was moved</label>
</div> </div>
</div> </div>
@ -248,15 +274,16 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Master password --> <!-- Master password -->
<div class="modal fade o_database_master" role="dialog"> <div class="modal fade o_database_master" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Set Master Password</h4> <h4 class="modal-title">Set Master Password</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form id="form_change_pwd" role="form" action="/web/database/change_password" method="post"> <form id="form_change_pwd" role="form" action="/web/database/change_password" method="post">
<div class="modal-body"> <div class="modal-body">
@ -265,9 +292,11 @@
<div class="form-group"> <div class="form-group">
<label for="master_pwd_new" class="col-form-label">New Master Password</label> <label for="master_pwd_new" class="col-form-label">New Master Password</label>
<div class="input-group"> <div class="input-group">
<input id="master_pwd_new" type="password" name="master_pwd_new" class="form-control" required="required" autocomplete="off"/> <input id="master_pwd_new" type="password" name="master_pwd_new" class="form-control"
required="required" autocomplete="off"/>
<div class="input-group-append"> <div class="input-group-append">
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span> <span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true"
style="cursor: pointer;"></span>
</div> </div>
</div> </div>
</div> </div>
@ -278,26 +307,30 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Duplicate DB --> <!-- Duplicate DB -->
<div class="modal fade o_database_duplicate" role="dialog"> <div class="modal fade o_database_duplicate" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Duplicate Database</h4> <h4 class="modal-title">Duplicate Database</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form id="form-duplicate-db" role="form" action="/web/database/duplicate" method="post"> <form id="form-duplicate-db" role="form" action="/web/database/duplicate" method="post">
<div class="modal-body"> <div class="modal-body">
{{ master_input() }} {{ master_input() }}
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Database Name</label> <label for="name" class="col-form-label">Database Name</label>
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> <input id="name" type="text" name="name" class="form-control" required="required"
readonly="readonly"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="new_name" class="col-form-label">New Name</label> <label for="new_name" class="col-form-label">New Name</label>
<input id="new_name" type="text" name="new_name" class="form-control" required="required" pattern="{{ pattern }}" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/> <input id="new_name" type="text" name="new_name" class="form-control" required="required"
pattern="{{ pattern }}"
title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -306,22 +339,24 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Drop DB --> <!-- Drop DB -->
<div class="modal fade o_database_delete" role="dialog"> <div class="modal fade o_database_delete" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Delete Database</h4> <h4 class="modal-title">Delete Database</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form id="form_drop_db" role="form" action="/web/database/drop" method="post"> <form id="form_drop_db" role="form" action="/web/database/drop" method="post">
<div class="modal-body"> <div class="modal-body">
{{ master_input() }} {{ master_input() }}
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Database</label> <label for="name" class="col-form-label">Database</label>
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> <input id="name" type="text" name="name" class="form-control" required="required"
readonly="readonly"/>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -330,22 +365,24 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Backup DB --> <!-- Backup DB -->
<div class="modal fade o_database_backup" role="dialog"> <div class="modal fade o_database_backup" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Backup Database</h4> <h4 class="modal-title">Backup Database</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form id="form_backup_db" role="form" action="/web/database/backup" method="post"> <form id="form_backup_db" role="form" action="/web/database/backup" method="post">
<div class="modal-body"> <div class="modal-body">
{{ master_input() }} {{ master_input() }}
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Database Name</label> <label for="name" class="col-form-label">Database Name</label>
<input id="name" type="text" name="name" class="form-control" required="required" readonly="readonly"/> <input id="name" type="text" name="name" class="form-control" required="required"
readonly="readonly"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="backup_format" class="col-form-label">Backup Format</label> <label for="backup_format" class="col-form-label">Backup Format</label>
@ -361,6 +398,6 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

11
odoo-debrand/views/res_config_views.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_inherit" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.remove.about</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">
<div id="about" position="replace"/>
</field>
</record>
</odoo>

5
odoo-debrand/views/views.xml

@ -26,4 +26,9 @@
</head> </head>
</xpath> </xpath>
</template> </template>
<template id="debrand_promotion" inherit_id="web.brand_promotion">
<xpath expr="//t[@t-call='web.brand_promotion_message']" position="replace"/>
</template>
</odoo> </odoo>
Loading…
Cancel
Save