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. 6
      odoo-debrand/models/models.py
  5. BIN
      odoo-debrand/static/description/images/debranding-03.png
  6. 40
      odoo-debrand/static/description/index.html
  7. 83
      odoo-debrand/static/src/js/title.js
  8. 3
      odoo-debrand/static/src/xml/base.xml
  9. 635
      odoo-debrand/views/database_manager_extend.html
  10. 11
      odoo-debrand/views/res_config_views.xml
  11. 9
      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,

6
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):
@ -33,5 +37,5 @@ class OdooDebrand(models.Model):
id = self.env['website'].sudo().search([]) id = self.env['website'].sudo().search([])
self.favicon_url ="/web/image/website/%s/favicon"%(id[0].id) self.favicon_url ="/web/image/website/%s/favicon"%(id[0].id)
favicon_url = fields.Text("Url", compute='get_favicon') favicon_url = fields.Text("Url", compute='get_favicon')
company_logo_url = fields.Text("Url", compute='get_company_logo') company_logo_url = fields.Text("Url", compute='get_company_logo')

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

40
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;">
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Updated warning messages. </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 User dropdown List (Remove 'Accounts and Documentation')</li>
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Page title modification. </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;">
<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;">

83
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) {
this._super(); start: function () {
var obj = this; this._super();
this._rpc({ var domain = session.user_context.allowed_company_ids;
fields: ['name',], var obj = this;
domain: [], this._rpc({
model: 'website', fields: ['name','id',],
method: 'search_read', domain: [['id', 'in', domain]],
limit: 1, model: 'res.company',
context: session.user_context,
})
.then(function (result) {
obj.set('title_part', {"zopenerp": result[0].name});
});
},
start: function () {
this._super();
this._rpc({
fields: ['name',],
domain: [],
model: 'website',
method: 'search_read', method: 'search_read',
limit: 1, })
context: session.user_context, .then(function (result) {
}) obj.set('title_part', {"zopenerp": result[0].name}); // Replacing the name 'Oodo' to selected company name near favicon
.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">

635
odoo-debrand/views/database_manager_extend.html

@ -1,30 +1,31 @@
<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">
<link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css"> <link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css">
<link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.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/jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript" src="/web/static/lib/popper/popper.js"></script> <script type="text/javascript" src="/web/static/lib/popper/popper.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/index.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/index.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/util.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/util.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/alert.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/alert.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/button.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/button.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/carousel.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/carousel.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/collapse.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/collapse.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/dropdown.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/dropdown.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/modal.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/modal.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/tooltip.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/tooltip.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/popover.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/popover.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/scrollspy.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/scrollspy.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/tab.js"></script> <script type="text/javascript" src="/web/static/lib/bootstrap/js/tab.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
// Little eye // Little eye
$('body').on('mousedown mouseup', '.o_little_eye', function (ev) { $('body').on('mousedown mouseup', '.o_little_eye', function (ev) {
@ -49,318 +50,354 @@
} }
}); });
}); });
</script>
</head>
{% macro master_input() -%} </script>
<div class="form-group"> </head>
{% if insecure %}
<input type="hidden" name="master_pwd" class="form-control" value="admin"/> {% macro master_input() -%}
{% else %} <div class="form-group">
<label for="master_pwd" class="col-form-label">Master Password</label> {% if insecure %}
<input id="master_pwd" type="password" name="master_pwd" class="form-control" required="required" autofocus="autofocus"/> <input type="hidden" name="master_pwd" class="form-control" value="admin"/>
{% endif %} {% else %}
<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"/>
{% endif %}
</div>
{%- endmacro %}
{% macro create_form() -%}
{{ master_input() }}
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label">Database Name</label>
<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"/>
</div>
</div>
<div class="form-group row">
<label for="login" class="col-md-4 col-form-label">Email</label>
<div class="col-md-8">
<input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/>
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label">Password</label>
<div class="col-md-8 input-group">
<input id="password" type="password" name="password" class="form-control" required="required"
autocomplete="off"/>
<div class="input-group-append">
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span>
</div> </div>
{%- endmacro %} </div>
</div>
<div class="form-group row">
<label for="phone" class="col-md-4 col-form-label">Phone number</label>
<div class="col-md-8 input-group">
<input id="phone" type="tel" name="phone" class="form-control" autocomplete="off"/>
</div>
</div>
<div class="form-group row">
<label for="lang" class="col-md-4 col-form-label">Language</label>
<div class="col-md-8">
<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>
<div class="form-group row">
<label for="country" class="col-md-4 col-form-label ">Country</label>
<div class="col-md-8">
<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 class="form-group row">
<label for="demo" class="col-md-4 col-form-label">Demo data</label>
<div class="col-md-8">
<input type="checkbox" id="load_demo_checkbox" class="form-control-sm" name="demo" value="1">
</div>
</div>
{%- endmacro %}
{% macro create_form() -%} <body>
{{ master_input() }} <div class="container">
<div class="form-group row"> <!-- Database List -->
<label for="name" class="col-md-4 col-form-label">Database Name</label> <div class="row">
<div class="col-md-8"> <div class="col-lg-6 offset-lg-3 o_database_list">
<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"/> <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"/>-->
{% if not list_db %}
<div class="alert alert-danger text-center">The database manager has been disabled by the administrator
</div> </div>
</div> {% elif insecure and databases %}
<div class="form-group row"> <div class="alert alert-warning ">
<label for="login" class="col-md-4 col-form-label">Email</label> Warning, {{ company_name }} database manager is not protected.<br/>
<div class="col-md-8"> Please <a href="#" data-toggle="modal" data-target=".o_database_master">set a master password</a> to
<input id="login" type="text" name="login" class="form-control" required="required" autocomplete="off"/> secure it.
</div> </div>
</div> {% endif %}
<div class="form-group row"> {% if error %}
<label for="password" class="col-md-4 col-form-label">Password</label> <div class="alert alert-danger">{{ error }}</div>
<div class="col-md-8 input-group"> {% endif %}
<input id="password" type="password" name="password" class="form-control" required="required" autocomplete="off"/> {% if list_db and databases %}
<div class="input-group-append"> <div class="list-group">
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span> {% for db in databases %}
<div class="list-group-item d-flex align-items-center">
<a href="/web?db={{ db }}" class="d-block flex-grow-1">
{% if db in incompatible_databases %}
<i class="icon fa fa-warning float-right text-warning"
title="This database may not be compatible"></i>
{% endif %}
{{ db }}
</a>
{% if manage %}
<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">
<i class="fa fa-floppy-o fa-fw"></i> Backup
</button>
<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
</button>
<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
</button>
</div>
{% endif %}
</div> </div>
{% endfor %}
</div> </div>
</div> {% if manage %}
<div class="form-group row"> <div class="d-flex mt-2">
<label for="phone" class="col-md-4 col-form-label">Phone number</label> <button type="button" data-toggle="modal" data-target=".o_database_create"
<div class="col-md-8 input-group"> class="btn btn-primary flex-grow-1">Create Database
<input id="phone" type="tel" name="phone" class="form-control" autocomplete="off"/> </button>
</div> <button type="button" data-toggle="modal" data-target=".o_database_restore"
</div> class="btn btn-primary flex-grow-1 ml-2">Restore Database
<div class="form-group row"> </button>
<label for="lang" class="col-md-4 col-form-label">Language</label> <button type="button" data-toggle="modal" data-target=".o_database_master"
<div class="col-md-8"> class="btn btn-primary flex-grow-1 ml-2">Set Master Password
<select id="lang" name="lang" class="form-control" required="required" autocomplete="off"> </button>
{% for lang in langs %}
<option {% if lang[0] == "en_US" %}selected="selected" {% endif %}value="{{ lang[0] }}">{{ lang[1] }}</option>
{% endfor %}
</select>
</div> </div>
</div> {% else %}
<div class="form-group row"> <div class="text-center mt-2">
<label for="country" class="col-md-4 col-form-label ">Country</label> <a href="/web/database/manager">Manage databases</a>
<div class="col-md-8">
<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 class="form-group row">
<label for="demo" class="col-md-4 col-form-label">Demo data</label>
<div class="col-md-8">
<input type="checkbox" id="load_demo_checkbox" class="form-control-sm" name="demo" value="1">
</div> </div>
{% endif %}
{% elif list_db %}
<form role="form" action="/web/database/create" method="post">
{{ create_form() }}
<input type="submit" value="Create database" class="btn btn-primary float-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>
{%- endmacro %} </div>
</div>
<body> <!-- Create -->
<div class="container"> <div class="modal fade o_database_create" role="dialog">
<!-- Database List --> <div class="modal-dialog">
<div class="row"> <div class="modal-content">
<div class="col-lg-6 offset-lg-3 o_database_list"> <form role="form" action="/web/database/create" method="post">
<img src="{{ company_logo_url }}" class="img-fluid d-block mx-auto"/> <div class="modal-header">
<!--<img src="/web/static/src/img/logo2.png" class="img-fluid d-block mx-auto"/>--> <h4 class="modal-title">Create Database</h4>
{% if not list_db %} <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
<div class="alert alert-danger text-center">The database manager has been disabled by the administrator</div> aria-hidden="true">&times;</span></button>
{% elif insecure and databases %}
<div class="alert alert-warning">
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.
</div>
{% endif %}
{% if error %}
<div class="alert alert-danger">{{ error }}</div>
{% endif %}
{% if list_db and databases %}
<div class="list-group">
{% for db in databases %}
<div class="list-group-item d-flex align-items-center">
<a href="/web?db={{ db }}" class="d-block flex-grow-1">
{% if db in incompatible_databases %}
<i class="icon fa fa-warning float-right text-warning" title="This database may not be compatible"></i>
{% endif %}
{{ db }}
</a>
{% if manage %}
<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">
<i class="fa fa-floppy-o fa-fw"></i> Backup
</button>
<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
</button>
<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
</button>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% if manage %}
<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_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>
{% else %}
<div class="text-center mt-2">
<a href="/web/database/manager">Manage databases</a>
</div>
{% endif %}
{% elif list_db %}
<form role="form" action="/web/database/create" method="post">
{{ create_form() }}
<input type="submit" value="Create database" class="btn btn-primary float-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>
</div> <div class="modal-body">
</div> {{ create_form() }}
<!-- 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">
<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>
</div>
<div class="modal-body">
{{ create_form() }}
</div>
<div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</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>
<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="col-form-label">File</label>
<input id="backup_file" type="file" name="backup_file" class="required"/>
</div> </div>
<form id="form_restore_db" role="form" action="/web/database/restore" method="post" enctype="multipart/form-data"> <div class="form-group">
<div class="modal-body"> <label for="name" class="col-form-label">Database Name</label>
{{ master_input() }} <input id="name" type="text" name="name" class="form-control" required="required"
<div class="form-group"> pattern="{{ pattern }}"
<label for="backup_file" class="col-form-label">File</label> title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/>
<input id="backup_file" type="file" name="backup_file" class="required"/> </div>
</div> <div class="form-group">
<div class="form-group"> <label for="copy">This database might have been moved or copied.</label>
<label for="name" class="col-form-label">Database Name</label> <p class="form-text">
<input id="name" type="text" name="name" class="form-control" required="required" pattern="{{ pattern }}" title="Only alphanumerical characters, underscore, hyphen and dot are allowed"/> In order to avoid conflicts between databases, needs to know if this database was moved or
</div> copied.<br/>
<div class="form-group"> If you don't know, answer "This database is a copy".
<label for="copy">This database might have been moved or copied.</label> </p>
<p class="form-text"> <div class="custom-control custom-radio">
In order to avoid conflicts between databases, needs to know if this database was moved or copied.<br/> <input id="radio_copy_true" name="copy" type="radio" class="custom-control-input"
If you don't know, answer "This database is a copy". value="true" checked="1">
</p> <label for="radio_copy_true" class="custom-control-label">This database is a copy</label>
<div class="custom-control custom-radio">
<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>
</div>
<div class="custom-control custom-radio">
<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>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="custom-control custom-radio">
<input type="submit" value="Continue" class="btn btn-primary float-right"/> <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>
</div> </div>
</form> </div>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</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>
</div> </button>
<form id="form_change_pwd" role="form" action="/web/database/change_password" method="post"> </div>
<div class="modal-body"> <form id="form_change_pwd" role="form" action="/web/database/change_password" method="post">
<p>The master password is required to create, delete, dump or restore databases.</p> <div class="modal-body">
{{ master_input() }} <p>The master password is required to create, delete, dump or restore databases.</p>
<div class="form-group"> {{ master_input() }}
<label for="master_pwd_new" class="col-form-label">New Master Password</label> <div class="form-group">
<div class="input-group"> <label for="master_pwd_new" class="col-form-label">New Master Password</label>
<input id="master_pwd_new" type="password" name="master_pwd_new" class="form-control" required="required" autocomplete="off"/> <div class="input-group">
<div class="input-group-append"> <input id="master_pwd_new" type="password" name="master_pwd_new" class="form-control"
<span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true" style="cursor: pointer;"></span> required="required" autocomplete="off"/>
</div> <div class="input-group-append">
</div> <span class="fa fa-eye o_little_eye input-group-text" aria-hidden="true"
style="cursor: pointer;"></span>
</div> </div>
</div> </div>
<div class="modal-footer"> </div>
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</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>
<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="col-form-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="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"/>
</div> </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="col-form-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="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"/>
</div>
</div>
<div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Continue" class="btn btn-primary float-right"/>
</div>
</form>
</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>
<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="col-form-label">Database</label>
<input id="name" type="text" name="name" class="form-control" required="required"
readonly="readonly"/>
</div> </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="col-form-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 float-right"/>
</div>
</form>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Delete" class="btn btn-primary float-right"/>
</div>
</form>
</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>
<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="col-form-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="col-form-label">Backup Format</label>
<select id="backup_format" name="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>
<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="col-form-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="col-form-label">Backup Format</label>
<select id="backup_format" name="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 float-right"/>
</div>
</form>
</div> </div>
</div> <div class="modal-footer">
<input type="submit" value="Backup" class="btn btn-primary float-right"/>
</div>
</form>
</div> </div>
</body> </div>
</div>
</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>

9
odoo-debrand/views/views.xml

@ -17,8 +17,8 @@
<script type="text/javascript"> <script type="text/javascript">
var odoo = { var odoo = {
csrf_token: "<t t-esc="request.csrf_token(None)"/>", csrf_token: "<t t-esc="request.csrf_token(None)"/>",
debug: "<t t-esc="debug"/>", debug: "<t t-esc="debug"/>",
}; };
</script> </script>
@ -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