init app_odoo v12

This commit is contained in:
ivan deng
2018-09-17 13:13:28 +08:00
parent b9ff0c210b
commit 17963fab85
223 changed files with 447 additions and 10032 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 138 KiB

View File

@@ -1,15 +1,19 @@
<section class="oe_container">
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_span12">
<h2 class="oe_slogan">App Odoo Customize</h2>
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher,
Online Documentation Access,Quick Data Clear. </p>
<h1>More Powerful UI addons:
<a class="btn btn-primary mb16" href="https://www.odoo.com/apps/modules/10.0/app_ui_enhance/">App UI enhance</a>
<h3>Lastest update: v11.0.7.23</h3>
<p>Fix Login bug when install website.</p>
<p>Add 19. One Click to clear all data (Sometime pls click twice)</p>
<p>Add 18. Show/Hide Author and Website in Apps Dashboard</p>
<h1>More Powerful addons:
<a class="btn btn-primary mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Sunpop.cn Addons</a>
</h1>
<br>
<h3>Lastest update: v10.0.2.4, 2018-02-04</h3>
<h3>Add Odoo 11 Support</h3>
<ul>
<li>1. Deletes Odoo label in footer</li>
<li>2. Replaces "Odoo" in Windows title</li>
@@ -24,10 +28,13 @@
<li>11. Provide 236 country flags.</li>
<li>12. Multi-language Support.</li>
<li>13. Change Powered by Odoo in login screen.(Please change '../views/app_odoo_customize_view.xml' #15)</li>
<li>14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Base Models.</li>
<li>14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Project/Base Models.</li>
<li>15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice...</li>
<li>16. Fix odoo reload module translation bug while enable english language</li>
<li>17. Stop Odoo Auto Subscribe(Performance Improve)</li>
<li>18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only)</li>
<li>19. One Click to clear all data (Sometime pls click twice)</li>
<li>20. Set System Icon (odoo 10 only)</li>
</ul>
<p>
This module can help to white label the Odoo.
@@ -44,7 +51,7 @@
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Odoo Customize(Debranding Title,Language,Documentation,Quick Debug)</h2>
@@ -67,7 +74,7 @@
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style=" argin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%; ">
<h2 class='oe_mt32'>How to use: Go to Settings -> odooApp Settings</h2>
@@ -78,7 +85,35 @@
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%; ">
<h2 class='oe_mt32'>Set System Icon (odoo 10 only)</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="set19.jpg" style="border:1px solid black"/>
<br/>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Show/Hide Author and Website in Apps Dashboard</h2>
</div>
<p>Before</p>
<div class="oe_demo oe_screenshot">
<img src="set18-1.jpg" style="border:1px solid black"/>
<br/>
</div>
<p>After uncheck "Show Author and Website in Apps Dashboard"</p>
<div class="oe_demo oe_screenshot">
<img src="set18-2.jpg" style="border:1px solid black"/>
<br/>
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Setup more flags: just rename the flag pic to locale code of the country</h2>
@@ -90,7 +125,7 @@
</div>
</div>
<div class="oe_row oe_spaced" style="max-width: 800px;">
<div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Quick Delete test Data.</h2>

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,4 +1,4 @@
odoo.define('app_system_name', function (require) {
odoo.define('app_odoo_customize.app_system_name', function (require) {
"use strict";
var WebClient = require('web.WebClient');

View File

@@ -1,117 +1,164 @@
odoo.define('app_odoo_customize.customize_user_menu', function (require) {
odoo.define('app_odoo_customize.UserMenu', function (require) {
"use strict";
var Model = require('web.Model');
var session = require('web.session');
/**
* This widget is appended by the webclient to the right of the navbar.
* It displays the avatar and the name of the logged user (and optionally the
* db name, in debug mode).
* If clicked, it opens a dropdown allowing the user to perform actions like
* editing its preferences, accessing the documentation, logging out...
*/
var UserMenu = require('web.UserMenu');
var documentation_url;
//避免错误,要再定义
var documentation_url = 'http://www.sunpop.cn';
var documentation_dev_url;
var support_url;
var account_title;
var account_url;
UserMenu.include({
on_menu_debug: function () {
window.location = $.param.querystring(window.location.href, 'debug');
init: function () {
this._super.apply(this, arguments);
var self = this;
var session = this.getSession();
var lang_list = '';
self._rpc({
model: 'res.lang',
method: 'search_read',
domain: [],
fields: ['name', 'code'],
lazy: false,
}).then(function (res) {
_.each(res, function (lang) {
var a = '';
if (lang['code'] === session.user_context.lang) {
a = '<i class="fa fa-check"></i>';
} else {
a = '';
}
lang_list += '<li><a href="#" data-lang-menu="lang" data-lang-id="' + lang['code'] + '"><img class="flag" src="app_odoo_customize/static/src/img/flags/' + lang['code'] + '.png"/>' + lang['name'] + a + '</a></li>';
});
lang_list += '<li class="divider"></li>';
$('switch-lang').replaceWith(lang_list);
})
//取参数
self._rpc({
model: 'ir.config_parameter',
method: 'search_read',
domain: [['key', '=like', 'app_%']],
fields: ['key', 'value'],
lazy: false,
}).then(function (res) {
$.each(res, function (key, val) {
if (val.key == 'app_documentation_url')
documentation_url = val.value;
if (val.key == 'app_documentation_dev_url')
documentation_dev_url = val.value;
if (val.key == 'app_support_url')
support_url = val.value;
if (val.key == 'app_account_title')
account_title = val.value;
if (val.key == 'app_account_url')
account_url = val.value;
// 控制显示
if (val.key == 'app_show_lang' && val.value == "False") {
$('switch-lang').hide();
}
if (session.user_context.uid!=1 || (val.key == 'app_show_debug' && val.value == "False")) {
$('[data-menu="debug"]').parent().hide();
$('[data-menu="debugassets"]').parent().hide();
$('[data-menu="quitdebug"]').parent().hide();
}
if (val.key == 'app_show_documentation' && val.value == "False") {
$('[data-menu="documentation"]').parent().hide();
}
if (val.key == 'app_show_documentation_dev' && val.value == "False") {
$('[data-menu="documentation_dev"]').parent().hide();
}
if (val.key == 'app_show_support' && val.value == "False") {
$('[data-menu="support"]').parent().hide();
}
if (val.key == 'app_show_account' && val.value == "False") {
$('[data-menu="account"]').parent().hide();
}
if (val.key == 'app_account_title' && val.value) {
$('[data-menu="account"]').html(account_title);
}
if (val.key == 'app_show_poweredby' && val.value == "False") {
$('.o_sub_menu_footer').hide();
}
});
})
},
on_menu_debugassets: function () {
window.location = $.param.querystring(window.location.href, 'debug=assets');
/**
* @override
* 由于odoo11 没传ev到事件所以要重载
*/
start: function () {
var self = this;
return this._super.apply(this, arguments).then(function () {
//语言切换特殊处理
self.$el.on('click', 'li a[data-lang-menu]', function (ev) {
ev.preventDefault();
var f = self['_onMenuLang']
f.call(self, $(this));
});
//控制debug显示
var mMode = 'normal';
if (window.location.href.indexOf('debug') != -1)
mMode = 'debug';
if (window.location.href.indexOf('debug=assets') != -1)
mMode = 'assets';
if (mMode == 'normal')
$('[data-menu="quitdebug"]').parent().hide();
if (mMode == 'debug')
$('[data-menu="debug"]').parent().hide();
if (mMode == 'assets')
$('[data-menu="debugassets"]').parent().hide();
});
},
on_menu_quitdebug: function () {
window.location.search = "?";
},
on_menu_documentation: function () {
window.open(documentation_url, '_blank');
},
on_menu_documentation_dev: function () {
window.open(documentation_dev_url, '_blank');
},
on_menu_support: function () {
window.open(support_url, '_blank');
},
on_menu_account: function () {
_onMenuAccount: function () {
window.open(account_url, '_blank');
},
});
_onMenuDocumentation: function () {
window.open(documentation_url, '_blank');
},
_onMenuSupport: function () {
window.open(support_url, '_blank');
},
//增加的方法
_onMenuDebug: function () {
window.location = $.param.querystring(window.location.href, 'debug');
},
_onMenuDebugassets: function () {
window.location = $.param.querystring(window.location.href, 'debug=assets');
},
_onMenuQuitdebug: function () {
window.location.search = "?";
},
_onMenuDocumentation_dev: function () {
window.open(documentation_dev_url, '_blank');
},
_onMenuLang: function (ev) {
var self = this;
var lang = ($(ev).data("lang-id"));
var session = this.getSession();
return this._rpc({
model: 'res.users',
method: 'write',
args: [session.uid, {'lang': lang}],
}).then(function (result) {
self.do_action({
type: 'ir.actions.client',
res_model: 'res.users',
tag: 'reload_context',
target: 'current',
});
});
},
})
$(document).ready(function () {
var self = this;
documentation_url = 'http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html';
documentation_dev_url = 'http://www.sunpop.cn/documentation/10.0/index.html';
support_url = 'http://www.sunpop.cn/trial';
account_title = 'My Online Account';
account_url = 'http://www.sunpop.cn/my-account';
setTimeout(function () {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_debug']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False")) {
$('[data-menu="debug"]').parent().hide();
$('[data-menu="debugassets"]').parent().hide();
$('[data-menu="quitdebug"]').parent().hide();
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_documentation']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('[data-menu="documentation"]').parent().hide();
else {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_documentation_url']], ['value']]).then(function (res) {
if (res.length >= 1) {
_.each(res, function (item) {
documentation_url = item['value'];
});
}
});
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_documentation_dev']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('[data-menu="documentation_dev"]').parent().hide();
else {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_documentation_dev_url']], ['value']]).then(function (res) {
if (res.length >= 1) {
_.each(res, function (item) {
documentation_dev_url = item['value'];
});
}
});
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_support']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('[data-menu="support"]').parent().hide();
else {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_support_url']], ['value']]).then(function (res) {
if (res.length >= 1) {
_.each(res, function (item) {
support_url = item['value'];
});
}
});
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_account']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('[data-menu="account"]').parent().hide();
else {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_account_title']], ['value']]).then(function (res) {
if (res.length >= 1) {
_.each(res, function (item) {
account_title = item['value'];
});
}
$('[data-menu="account"]').html(account_title);
});
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_account_url']], ['value']]).then(function (res) {
if (res.length >= 1) {
_.each(res, function (item) {
account_url = item['value'];
});
}
});
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_poweredby']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('.o_sub_menu_footer').hide();
});
}, 2500);
});
})
});

View File

@@ -1,49 +0,0 @@
odoo.define('app_odoo_customize.switch_language', function (require) {
"use strict";
var Model = require('web.Model');
var session = require('web.session');
var UserMenu = require('web.UserMenu');
UserMenu.include({
on_menu_lang: function (ev) {
var self = this;
var lang = ($(ev).data("lang-id"));
new Model('res.users').call('write', [[session.uid], {'lang': lang}]).then(function () {
self.do_action({
type: 'ir.actions.client',
res_model: 'res.users',
tag: 'reload_context',
target: 'current'
});
});
return false;
},
});
//
$(document).ready(function () {
var self = this;
var lang_list = '';
setTimeout(function () {
new Model('ir.config_parameter').call('search_read', [[['key', '=', 'app_show_lang']], ['value']]).then(function (show) {
if (show.length >= 1 && (show[0]['value'] == "False"))
$('switch-lang').hide();
else {
new Model('res.lang').call('search_read', [[], ['name', 'code']]).then(function (res) {
_.each(res, function (lang) {
var a = '';
if (lang['code'] === session.user_context.lang) {
a = '<i class="fa fa-check"></i>';
} else {
a = '';
}
lang_list += '<li><a href="#" data-menu="lang" data-lang-id="' + lang['code'] + '"><img class="flag" src="app_odoo_customize/static/src/img/flags/' + lang['code'] + '.png"/>' + lang['name'] + a + '</a></li>';
});
lang_list += '<li class="divider"></li>';
$('switch-lang').replaceWith(lang_list);
});
}
});
}, 2500);
});
});

View File

@@ -3,13 +3,13 @@
<t t-extend="UserMenu">
<t t-jquery=".dropdown-menu" t-operation="prepend">
<switch-lang/>
<li t-if="widget.session.debug != true">
<li>
<a href="#" data-menu="debug">Activate the developer mode</a>
</li>
<li t-if="widget.session.debug != 'assets'">
<li>
<a href="#" data-menu="debugassets">Activate the developer mode (with assets)</a>
</li>
<li t-if="widget.session.debug != false">
<li>
<a href="#" data-menu="quitdebug">Deactivate the developer mode</a>
</li>
<li>