diff --git a/app_dynamic_list/__init__.py b/app_dynamic_list/__init__.py deleted file mode 100644 index faaaf799..00000000 --- a/app_dynamic_list/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - - diff --git a/app_dynamic_list/__openerp__.py b/app_dynamic_list/__openerp__.py deleted file mode 100644 index 3f1dd57b..00000000 --- a/app_dynamic_list/__openerp__.py +++ /dev/null @@ -1,34 +0,0 @@ - -{ - 'name': 'App Customize Columns of List (Tree) View Dynamic', - 'version': '10.0.1.6', - 'author': 'Sunpop.cn', - 'category': 'Productivity', - 'website': 'http://www.odooapp.cn', - 'sequence': 2, - 'summary': 'App Customize columns of List (Tree) View. Dynamic list.', - 'description': """ - -App Customize Columns of List (Tree) View -============ -App Customize Columns of List (Tree) View module is made to show/hide the columns on the list/tree view of Odoo. After installing the module, a "Set Columns" button will be show to the list view. -You can customize every odoo list/tree view easily. - -This module is ready for Community and Enterprise Edition. - - """, - 'images': ['static/description/sales_coms.jpg' - ], - 'depends': ['web'], - 'data': [ - 'views/listview_button.xml', - ], - 'demo': [], - 'test': [ - ], - 'installable': True, - 'application': True, - 'auto_install': False, - 'qweb': ['static/src/xml/listview_button_view.xml'], -} - diff --git a/app_dynamic_list/i18n/zh_CN.po b/app_dynamic_list/i18n/zh_CN.po deleted file mode 100644 index c07d57f0..00000000 --- a/app_dynamic_list/i18n/zh_CN.po +++ /dev/null @@ -1,24 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * apps_material_backend_theme -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0c\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-07 08:57+0000\n" -"PO-Revision-Date: 2016-09-07 08:57+0000\n" -"Last-Translator: Ivan Deng <300883@qq.com>, 2017\n" -"Language-Team: Chinese (China) (https://www.transifex.com/odoo/teams/41243/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: app_dynamic_list -#. openerp-web -#: code:addons/apps_material_backend_theme/static/src/xml/listview_button_view.xml:121 -#, python-format -msgid "Set Columns" -msgstr "显示列" diff --git a/app_dynamic_list/images/dynamiclist_homepage.jpg b/app_dynamic_list/images/dynamiclist_homepage.jpg deleted file mode 100644 index 5563db16..00000000 Binary files a/app_dynamic_list/images/dynamiclist_homepage.jpg and /dev/null differ diff --git a/app_dynamic_list/static/description/icon.png b/app_dynamic_list/static/description/icon.png deleted file mode 100644 index 2a04f219..00000000 Binary files a/app_dynamic_list/static/description/icon.png and /dev/null differ diff --git a/app_dynamic_list/static/description/index.html b/app_dynamic_list/static/description/index.html deleted file mode 100644 index f75d97bc..00000000 --- a/app_dynamic_list/static/description/index.html +++ /dev/null @@ -1,62 +0,0 @@ -
-
-
-

Customize hide/show the columns on the list (tree) view dynamically

-
-

This moduld allows user to customize columns dynamically in list (tree) view of any object of any - installed module.

- -
-

"Set Columns" button contains all field(s) in dropdown with checkbox which will exist in - list view of current object. So if user wants to show/hide any field, then he/she has to just do - check/uncheck that respective checkbox besides field name in dropdown list and then just click on - "Apply" button.

-
-
-
- - -
- -
-
    -
  • Sales leads in Enterprise Edition

  • -
-
-
- -
-
- -
-
    -
  • Sales leads in Community Edition

  • -
-
- -
- -
-
-
- -
-
-
-
-

Technical Help & Support

-
-
-
-

- For any type of technical help & support requests, Feel free to contact us

- - guohuadeng@hotmail.com -
-
-
-
diff --git a/app_dynamic_list/static/description/sales_com.png b/app_dynamic_list/static/description/sales_com.png deleted file mode 100644 index 48b199f5..00000000 Binary files a/app_dynamic_list/static/description/sales_com.png and /dev/null differ diff --git a/app_dynamic_list/static/description/sales_ent.png b/app_dynamic_list/static/description/sales_ent.png deleted file mode 100644 index 55986b90..00000000 Binary files a/app_dynamic_list/static/description/sales_ent.png and /dev/null differ diff --git a/app_dynamic_list/static/src/css/my.css b/app_dynamic_list/static/src/css/my.css deleted file mode 100644 index e69de29b..00000000 diff --git a/app_dynamic_list/static/src/js/dynamic_list.js b/app_dynamic_list/static/src/js/dynamic_list.js deleted file mode 100644 index dd4f8470..00000000 --- a/app_dynamic_list/static/src/js/dynamic_list.js +++ /dev/null @@ -1,97 +0,0 @@ -odoo.define('app_dynamic_list.shcolumns', function (require) { -"use strict"; - -var core = require('web.core'); -var ListView = require('web.ListView'); -var QWeb = core.qweb; - -ListView.include({ - reload: function () { - this.setup_columns(this.fields_view.fields, this.grouped); - this.$el.html(QWeb.render(this._template, this)); - return this.reload_content(); - }, - - render_buttons: function($node) { - var self = this; - this._super($node); - this.$buttons.find('.oe_select_columns').click(this.proxy('my_setup_columns')); - this.$buttons.find('.oe_dropdown_btn').click(this.proxy('hide_show_columns')); - this.$buttons.find('.dropdown-menu').click(this.proxy('stop_event')); - }, - - my_setup_columns: function (fields, grouped) { - $("#showcb").toggle(); - var getcb = document.getElementById('showcb'); - this.visible_columns = _.filter(this.columns, function (column) { - var firstcheck = document.getElementById(column.id); - if(firstcheck == null) - { - var li= document.createElement("li"); - var description = document.createTextNode(column.string); - var checkbox = document.createElement("input"); - checkbox.id = column.id; - checkbox.type = "checkbox"; - checkbox.name = "cb"; - - if(column.invisible !== '1') - { - checkbox.checked = true; - } - li.appendChild(checkbox); - li.appendChild(description); - getcb.appendChild(li); - } - else - { - if(column.invisible !== '1') - { - firstcheck.checked = true; - } - else - { - firstcheck.checked = false; - } - } - }); - }, - stop_event : function(e) - { - e.stopPropagation(); - }, - - hide_show_columns : function() - { - $("#showcb").hide(); - this.setup_columns(this.fields_view.fields, this.grouped); - this.$el.html(QWeb.render(this._template, this)); - return this.reload_content(); - }, - - setup_columns: function (fields, grouped) { - this._super(fields, grouped); - this.visible_columns = _.filter(this.columns, function (column) { - var cbid = document.getElementById(column.id); - if(cbid !== null) - { - var cbid = cbid.checked; - if(cbid !== false) - { - column.invisible = '2'; - } - else - { - column.invisible = '1'; - } - } - return column.invisible !== '1'; - }); - this.aggregate_columns = _(this.visible_columns).invoke('to_aggregate'); - }, -}); - -$(document).click(function(){ - $("#showcb").hide(); -}); - -}); diff --git a/app_dynamic_list/static/src/xml/listview_button_view.xml b/app_dynamic_list/static/src/xml/listview_button_view.xml deleted file mode 100644 index a5c0e58f..00000000 --- a/app_dynamic_list/static/src/xml/listview_button_view.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - -
- - - -
-
-
-
diff --git a/app_dynamic_list/views/listview_button.xml b/app_dynamic_list/views/listview_button.xml deleted file mode 100644 index fdad6af3..00000000 --- a/app_dynamic_list/views/listview_button.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/app_odoo_customize/__init__.py b/app_odoo_customize/__init__.py index e49c8b6f..50b5fd50 100644 --- a/app_odoo_customize/__init__.py +++ b/app_odoo_customize/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -import models +from . import models diff --git a/app_odoo_customize/__openerp__.py b/app_odoo_customize/__manifest__.py similarity index 79% rename from app_odoo_customize/__openerp__.py rename to app_odoo_customize/__manifest__.py index fd243a50..a5f93cd3 100644 --- a/app_odoo_customize/__openerp__.py +++ b/app_odoo_customize/__manifest__.py @@ -15,19 +15,23 @@ # http://www.sunpop.cn/odoo10_developer_document_offline/ # description: { - 'name': 'App Odoo Customize(Backend Debranding Title,Language,Documentation,Quick Debug,Delete clear)', - 'version': '10.0.2.4', + 'name': 'App Odoo Customize(Backend Debranding Title,Language,Documentation,Quick Debug,Clear Data)', + 'version': '11.0.9.12', 'author': 'Sunpop.cn', 'category': 'Productivity', 'website': 'http://www.sunpop.cn', 'license': 'AGPL-3', 'sequence': 2, - 'summary': 'Quick customize and debranding your own Odoo. Quick debug, Language Switcher, Online Documentation Access,Delete test data.', + 'summary': """ + Keyword: odoo debrand, odoo debranding, customize my odoo. + Quick customize and debranding your own Odoo. Quick debug, Language Switcher, Online Documentation Access,Delete test data. + """, 'description': """ App Odoo Customize(Debranding Title,Language,Documentation,Quick Debug) ============ White label odoo. +Support Odoo 11, 10, 9. You can config odoo, make it look like your own platform. 1. Deletes Odoo label in footer 2. Replaces "Odoo" in Windows title @@ -42,10 +46,12 @@ You can config odoo, make it look like your own platform. 11. Provide 236 country flags. 12. Multi-language Support. 13. Change Powered by Odoo in login screen.(Please change '../views/app_odoo_customize_view.xml' #15) -14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Message/Workflow etc. +14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Project/Message/Workflow etc. 15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice... 16. Fix odoo reload module translation bug while enable english language 17. Stop Odoo Auto Subscribe(Performance Improve) +18. Show/Hide Author and Website in Apps Dashboard +19. One Click to clear all data (Sometime pls click twice) This module can help to white label the Odoo. Also helpful for training and support for your odoo end-user. @@ -53,12 +59,16 @@ The user can get the help document just by one click. """, 'images': ['static/description/banner.png'], - 'depends': ['web','mail'], + 'depends': ['base', 'web', 'mail'], 'data': [ 'views/app_odoo_customize_view.xml', 'views/app_theme_config_settings_view.xml', + 'views/ir_model_view.xml', # data 'data/ir_config_parameter.xml', + 'data/res_company_data.xml', + 'data/res_groups.xml', + 'security/ir.model.access.csv', ], 'demo': [], 'test': [ @@ -70,4 +80,3 @@ The user can get the help document just by one click. 'static/src/xml/customize_user_menu.xml', ], } - diff --git a/app_odoo_customize/data/ir_config_parameter.xml b/app_odoo_customize/data/ir_config_parameter.xml index ede752c1..83c6f08d 100644 --- a/app_odoo_customize/data/ir_config_parameter.xml +++ b/app_odoo_customize/data/ir_config_parameter.xml @@ -46,7 +46,7 @@ app_stop_subscribe False - + app_documentation_url http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html diff --git a/app_odoo_customize/data/res_company_data.xml b/app_odoo_customize/data/res_company_data.xml new file mode 100644 index 00000000..12383a49 --- /dev/null +++ b/app_odoo_customize/data/res_company_data.xml @@ -0,0 +1,10 @@ + + + + + + http://www.sunpop.cn + + + + \ No newline at end of file diff --git a/app_odoo_customize/data/res_groups.xml b/app_odoo_customize/data/res_groups.xml new file mode 100644 index 00000000..8597adc6 --- /dev/null +++ b/app_odoo_customize/data/res_groups.xml @@ -0,0 +1,10 @@ + + + + + + Show Author and Website in Apps Dashboard + + + + \ No newline at end of file diff --git a/app_odoo_customize/i18n/zh_CN.po b/app_odoo_customize/i18n/zh_CN.po index aea4159b..854684ae 100644 --- a/app_odoo_customize/i18n/zh_CN.po +++ b/app_odoo_customize/i18n/zh_CN.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0+e-20171107\n" +"Project-Id-Version: Odoo Server 11.0+e-20180313\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-10 11:41+0000\n" -"PO-Revision-Date: 2018-01-10 11:41+0000\n" +"POT-Creation-Date: 2018-03-22 17:49+0000\n" +"PO-Revision-Date: 2018-03-22 17:49+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -34,6 +34,11 @@ msgstr "激活开发者模式" msgid "Activate the developer mode (with assets)" msgstr "激活开发者模式 (assets)" +#. module: app_odoo_customize +#: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings +msgid "All Business" +msgstr "所有业务" + #. module: app_odoo_customize #: model:ir.model,name:app_odoo_customize.model_app_theme_config_settings msgid "App Odoo Customize settings" @@ -57,7 +62,7 @@ msgstr "取消" #. module: app_odoo_customize #: model:ir.model.fields,help:app_odoo_customize.field_app_theme_config_settings_app_stop_subscribe msgid "Check to stop Odoo Subscribe function" -msgstr "Check to stop Odoo Subscribe function" +msgstr "选中可停止odoo内置的用户消息订阅" #. module: app_odoo_customize #: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings_create_uid @@ -86,6 +91,11 @@ msgstr "取消激活开发者模式" msgid "Delete All BOM" msgstr "删除所有物料清单" +#. module: app_odoo_customize +#: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings +msgid "Delete All MRP/Sale/Purchase/Account/MRP/Inventory/Project/Message/Workflow" +msgstr "清除所有业务数据 MRP/Sale/Purchase/Account/MRP/Inventory/Project/Message/Workflow" + #. module: app_odoo_customize #: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings msgid "Delete All Manufacturing Order" @@ -116,6 +126,11 @@ msgstr "删除所有产品及变体" msgid "Delete All Product Attribute" msgstr "删除所有产品属性" +#. module: app_odoo_customize +#: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings +msgid "Delete All Project/Task/Forecast" +msgstr "删除所有项目/任务/预测" + #. module: app_odoo_customize #: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings msgid "Delete All Purchase Order and Requisition" @@ -186,12 +201,12 @@ msgstr "显示/隐藏菜单项" #. module: app_odoo_customize #: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings___last_update msgid "Last Modified on" -msgstr "最后修改日" +msgstr "最后修改时间" #. module: app_odoo_customize #: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings_write_uid msgid "Last Updated by" -msgstr "最后更新人" +msgstr "最后更新者" #. module: app_odoo_customize #: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings_write_date @@ -229,9 +244,9 @@ msgid "Please confirm to delete the select data?" msgstr "确认删除指定数据?" #. module: app_odoo_customize -#: model:ir.ui.view,arch_db:app_odoo_customize.replace_login -msgid "Powered by odooApp" -msgstr "技术支持 odooApp" +#: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings +msgid "Project" +msgstr "项目" #. module: app_odoo_customize #: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings @@ -248,6 +263,12 @@ msgstr "销售" msgid "Setup System Name,which replace Odoo" msgstr "设置系统名称,取代Odoo" +#. module: app_odoo_customize +#: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings_group_show_author_in_apps +#: model:res.groups,name:app_odoo_customize.group_show_author_in_apps +msgid "Show Author and Website in Apps Dashboard" +msgstr "显示应用的作者和网站-在应用安装面板中" + #. module: app_odoo_customize #: model:ir.model.fields,field_description:app_odoo_customize.field_app_theme_config_settings_app_show_documentation_dev msgid "Show Developer Documentation" @@ -309,6 +330,11 @@ msgstr "支持链接" msgid "System Name" msgstr "系统名称" +#. module: app_odoo_customize +#: model:ir.model.fields,help:app_odoo_customize.field_app_theme_config_settings_group_show_author_in_apps +msgid "Uncheck to Hide Author and Website in Apps Dashboard" +msgstr "Uncheck to Hide Author and Website in Apps Dashboard" + #. module: app_odoo_customize #: model:ir.model.fields,help:app_odoo_customize.field_app_theme_config_settings_app_show_enterprise msgid "Uncheck to hide the Enterprise tag" @@ -379,17 +405,17 @@ msgstr "个性化odoo设置" msgid "ir.ui.view" msgstr "ir.ui.view" +#. module: app_odoo_customize +#: model:ir.ui.menu,name:base.menu_app_group +msgid "odooApp" +msgstr "odooApp" + #. module: app_odoo_customize #: model:ir.actions.act_window,name:app_odoo_customize.action_app_theme_config #: model:ir.ui.menu,name:app_odoo_customize.menu_app_theme_config msgid "odooApp Customize" msgstr "odooApp 定制" -#. module: app_odoo_customize -#: model:ir.ui.menu,name:app_odoo_customize.menu_app_group -msgid "odooApp" -msgstr "odooApp" - #. module: app_odoo_customize #: model:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings msgid "odooApp Customize Settings" diff --git a/app_odoo_customize/models/__init__.py b/app_odoo_customize/models/__init__.py index 36ac87dc..6de04395 100644 --- a/app_odoo_customize/models/__init__.py +++ b/app_odoo_customize/models/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import ir_ui_view -import app_theme_config_settings -import base_language_install -import mail_thread +from . import app_theme_config_settings +from . import ir_ui_view +from . import base_language_install +# from . import mail_thread diff --git a/app_odoo_customize/models/app_theme_config_settings.py b/app_odoo_customize/models/app_theme_config_settings.py index 44079a48..b1803edd 100644 --- a/app_odoo_customize/models/app_theme_config_settings.py +++ b/app_odoo_customize/models/app_theme_config_settings.py @@ -25,6 +25,8 @@ class AppThemeConfigSettings(models.TransientModel): app_show_share = fields.Boolean('Show Share Dashboard', help=u"Uncheck to hide the Odoo Share Dashboard") app_show_poweredby = fields.Boolean('Show Powered by Odoo', help=u"Uncheck to hide the Powered by text") app_stop_subscribe = fields.Boolean('Stop Odoo Subscribe(Performance Improve)', help=u"Check to stop Odoo Subscribe function") + group_show_author_in_apps = fields.Boolean(string="Show Author and Website in Apps Dashboard", implied_group='app_odoo_customize.group_show_author_in_apps', + help=u"Uncheck to Hide Author and Website in Apps Dashboard") app_documentation_url = fields.Char('Documentation Url') app_documentation_dev_url = fields.Char('Developer Documentation Url') @@ -33,28 +35,28 @@ class AppThemeConfigSettings(models.TransientModel): app_account_url = fields.Char('My Odoo.com Account Url') @api.model - def get_default_all(self, fields): + def get_values(self): ir_config = self.env['ir.config_parameter'] - app_system_name = ir_config.get_param('app_system_name', default='odooApp') + app_system_name = ir_config.sudo().get_param('app_system_name', default='odooApp') - app_show_lang = True if ir_config.get_param('app_show_lang') == "True" else False - app_show_debug = True if ir_config.get_param('app_show_debug') == "True" else False - app_show_documentation = True if ir_config.get_param('app_show_documentation') == "True" else False - app_show_documentation_dev = True if ir_config.get_param('app_show_documentation_dev') == "True" else False - app_show_support = True if ir_config.get_param('app_show_support') == "True" else False - app_show_account = True if ir_config.get_param('app_show_account') == "True" else False - app_show_enterprise = True if ir_config.get_param('app_show_enterprise') == "True" else False - app_show_share = True if ir_config.get_param('app_show_share') == "True" else False - app_show_poweredby = True if ir_config.get_param('app_show_poweredby') == "True" else False - app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False + app_show_lang = True if ir_config.sudo().get_param('app_show_lang') == "True" else False + app_show_debug = True if ir_config.sudo().get_param('app_show_debug') == "True" else False + app_show_documentation = True if ir_config.sudo().get_param('app_show_documentation') == "True" else False + app_show_documentation_dev = True if ir_config.sudo().get_param('app_show_documentation_dev') == "True" else False + app_show_support = True if ir_config.sudo().get_param('app_show_support') == "True" else False + app_show_account = True if ir_config.sudo().get_param('app_show_account') == "True" else False + app_show_enterprise = True if ir_config.sudo().get_param('app_show_enterprise') == "True" else False + app_show_share = True if ir_config.sudo().get_param('app_show_share') == "True" else False + app_show_poweredby = True if ir_config.sudo().get_param('app_show_poweredby') == "True" else False + app_stop_subscribe = True if ir_config.sudo().get_param('app_stop_subscribe') == "True" else False - app_documentation_url = ir_config.get_param('app_documentation_url', + app_documentation_url = ir_config.sudo().get_param('app_documentation_url', default='http://www.sunpop.cn/documentation/user/10.0/en/index.html') - app_documentation_dev_url = ir_config.get_param('app_documentation_dev_url', + app_documentation_dev_url = ir_config.sudo().get_param('app_documentation_dev_url', default='http://www.sunpop.cn/documentation/10.0/index.html') - app_support_url = ir_config.get_param('app_support_url', default='http://www.sunpop.cn/trial/') - app_account_title = ir_config.get_param('app_account_title', default='My Online Account') - app_account_url = ir_config.get_param('app_account_url', default='http://www.sunpop.cn/my-account/') + app_support_url = ir_config.sudo().get_param('app_support_url', default='http://www.sunpop.cn/trial/') + app_account_title = ir_config.sudo().get_param('app_account_title', default='My Online Account') + app_account_url = ir_config.sudo().get_param('app_account_url', default='http://www.sunpop.cn/my-account/') return dict( app_system_name=app_system_name, app_show_lang=app_show_lang, @@ -67,7 +69,7 @@ class AppThemeConfigSettings(models.TransientModel): app_show_share=app_show_share, app_show_poweredby=app_show_poweredby, app_stop_subscribe=app_stop_subscribe, - + app_documentation_url=app_documentation_url, app_documentation_dev_url=app_documentation_dev_url, app_support_url=app_support_url, @@ -76,7 +78,7 @@ class AppThemeConfigSettings(models.TransientModel): ) @api.multi - def set_default_all(self): + def set_values(self): self.ensure_one() ir_config = self.env['ir.config_parameter'] ir_config.set_param("app_system_name", self.app_system_name or "") @@ -90,6 +92,7 @@ class AppThemeConfigSettings(models.TransientModel): ir_config.set_param("app_show_share", self.app_show_share or "False") ir_config.set_param("app_show_poweredby", self.app_show_poweredby or "False") ir_config.set_param("app_stop_subscribe", self.app_stop_subscribe or "False") + # ir_config.set_param("group_show_author_in_apps", self.group_show_author_in_apps or "False") ir_config.set_param("app_documentation_url", self.app_documentation_url or "http://www.sunpop.cn/documentation/user/10.0/en/index.html") @@ -109,10 +112,10 @@ class AppThemeConfigSettings(models.TransientModel): ['sale.order', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号 @@ -123,7 +126,7 @@ class AppThemeConfigSettings(models.TransientModel): }) sql = "update ir_sequence set number_next=1 where code ='sale.order';" self._cr.execute(sql) - except Exception, e: + except Exception as e: raise Warning(e) return True @@ -134,10 +137,10 @@ class AppThemeConfigSettings(models.TransientModel): ['product.template', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号,针对自动产品编号 @@ -148,8 +151,8 @@ class AppThemeConfigSettings(models.TransientModel): }) sql = "update ir_sequence set number_next=1 where code ='product.product';" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True def remove_product_attribute(self): @@ -159,14 +162,14 @@ class AppThemeConfigSettings(models.TransientModel): ['product.attribute', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -177,10 +180,10 @@ class AppThemeConfigSettings(models.TransientModel): ['pos.order', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号 @@ -191,8 +194,8 @@ class AppThemeConfigSettings(models.TransientModel): }) sql = "update ir_sequence set number_next=1 where code ='pos.order';" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -205,10 +208,10 @@ class AppThemeConfigSettings(models.TransientModel): ['purchase.requisition', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号 @@ -219,8 +222,8 @@ class AppThemeConfigSettings(models.TransientModel): }) sql = "update ir_sequence set number_next=1 where code ='purchase.order';" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -230,16 +233,19 @@ class AppThemeConfigSettings(models.TransientModel): ['mrp.workcenter.productivity', ], ['mrp.workorder', ], ['mrp.production.workcenter.line', ], + ['change.production.qty', ], ['mrp.production', ], ['mrp.production.product.line', ], ['mrp.unbuild', ], ['change.production.qty', ], + ['sale.forecast.indirect', ], + ['sale.forecast', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号 @@ -250,8 +256,8 @@ class AppThemeConfigSettings(models.TransientModel): }) sql = "update ir_sequence set number_next=1 where (code ='mrp.production' or code ='mrp.unbuild');" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -262,14 +268,14 @@ class AppThemeConfigSettings(models.TransientModel): ['mrp.bom', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -279,6 +285,7 @@ class AppThemeConfigSettings(models.TransientModel): ['stock.quant', ], ['stock.quant.package', ], ['stock.quant.move.rel', ], + ['stock.move.line', ], ['stock.move', ], ['stock.pack.operation', ], ['stock.picking', ], @@ -292,10 +299,10 @@ class AppThemeConfigSettings(models.TransientModel): ['procurement.group', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) # 更新序号 @@ -333,8 +340,8 @@ class AppThemeConfigSettings(models.TransientModel): "or prefix ='WH/PICK/'" \ ");" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -354,10 +361,10 @@ class AppThemeConfigSettings(models.TransientModel): ['account.move', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj: sql = "delete from %s" % obj._table self._cr.execute(sql) @@ -382,7 +389,7 @@ class AppThemeConfigSettings(models.TransientModel): seq.write({ 'number_next': 1, }) - # todo: 帐单 or BILL/% + # todo: 帐单 or BILL/% sql = "update ir_sequence set number_next=1 where (" \ "code ='account.reconcile' " \ "or code ='account.payment.customer.invoice' " \ @@ -398,8 +405,29 @@ class AppThemeConfigSettings(models.TransientModel): "or prefix like '杂项/%'" \ ");" self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) + return True + + @api.multi + def remove_project(self): + to_removes = [ + # 清除项目 + ['account.analytic.line', ], + ['project.task', ], + ['project.forecast', ], + ['project.project', ], + ] + try: + for line in to_removes: + obj_name = line[0] + obj = self.pool.get(obj_name) + if obj: + sql = "delete from %s" % obj._table + self._cr.execute(sql) + # 更新序号 + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -410,14 +438,14 @@ class AppThemeConfigSettings(models.TransientModel): ['mail.followers', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj and obj._table: sql = "delete from %s" % obj._table self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) return True @api.multi @@ -428,13 +456,27 @@ class AppThemeConfigSettings(models.TransientModel): ['wkf.instance', ], ] try: - for line in to_removes : + for line in to_removes: obj_name = line[0] obj = self.pool.get(obj_name) - if obj and obj._table_exist: + if obj and obj._table: sql = "delete from %s" % obj._table self._cr.execute(sql) - except Exception, e: - raise Warning(e) + except Exception as e: + pass # raise Warning(e) + return True + + @api.multi + def remove_all_biz(self): + try: + self.remove_sales() + self.remove_purchase() + self.remove_account() + self.remove_mrp() + self.remove_inventory() + self.remove_project() + self.remove_message() + except Exception as e: + pass # raise Warning(e) return True diff --git a/app_odoo_customize/models/ir_ui_view.py b/app_odoo_customize/models/ir_ui_view.py index eca8ed13..dfed0827 100644 --- a/app_odoo_customize/models/ir_ui_view.py +++ b/app_odoo_customize/models/ir_ui_view.py @@ -14,5 +14,5 @@ class View(models.Model): if template in ['web.login', 'web.webclient_bootstrap']: if not values: values = {} - values["title"] = self.env['ir.config_parameter'].get_param("app_system_name", "odooApp") + values["title"] = self.env['ir.config_parameter'].sudo().get_param("app_system_name", "odooApp") return super(View, self).render_template(template, values=values, engine=engine) \ No newline at end of file diff --git a/app_odoo_customize/models/mail_thread.py b/app_odoo_customize/models/mail_thread.py index ec59b6e6..3e979303 100644 --- a/app_odoo_customize/models/mail_thread.py +++ b/app_odoo_customize/models/mail_thread.py @@ -12,7 +12,7 @@ class MailThread(models.AbstractModel): def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None, force=True): """ 停用订阅功能. """ ir_config = self.env['ir.config_parameter'] - app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False + app_stop_subscribe = False if ir_config.get_param('app_stop_subscribe') == "True" else False if app_stop_subscribe: return else: @@ -22,7 +22,7 @@ class MailThread(models.AbstractModel): def message_auto_subscribe(self, updated_fields, values=None): """ 停用订阅功能. """ ir_config = self.env['ir.config_parameter'] - app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False + app_stop_subscribe = False if ir_config.get_param('app_stop_subscribe') == "True" else False if app_stop_subscribe: return else: @@ -32,7 +32,7 @@ class MailThread(models.AbstractModel): def _message_auto_subscribe_notify(self, partner_ids): """ 停用订阅功能. """ ir_config = self.env['ir.config_parameter'] - app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False + app_stop_subscribe = False if ir_config.get_param('app_stop_subscribe') == "True" else False if app_stop_subscribe: return else: diff --git a/app_odoo_customize/readme.md b/app_odoo_customize/readme.md index dcde3067..fcf33233 100644 --- a/app_odoo_customize/readme.md +++ b/app_odoo_customize/readme.md @@ -1,6 +1,7 @@ ##App Odoo Customize(Debranding Title,Language,Documentation,Quick Debug,Quick Data Clear) ============ -White label odoo. +White label odoo. +Support Odoo 11, 10, 9. You can config odoo, make it look like your own platform. 1. Deletes Odoo label in footer 2. Replaces "Odoo" in Windows title @@ -19,6 +20,8 @@ You can config odoo, make it look like your own platform. 15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice... 16. Fix odoo reload module translation bug while enable english language 17. Stop Odoo Auto Subscribe(Performance Improve) +18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only) +19. Set System Icon (odoo 10 only) This module can help to white label the Odoo. Also helpful for training and support for your odoo end-user. The user can get the help document just by one click. @@ -41,10 +44,12 @@ http://www.sunpop.cn 11. 提供236个国家的国旗文件(部份需要自行设置文件名) 12. 多语言版本 13. 自定义登陆界面中的 Powered by Odoo -14. 快速删除测试数据,支持模块包括:销售/POS门店/采购/生产/库存/会计/消息与工作流等. +14. 快速删除测试数据,支持模块包括:销售/POS门店/采购/生产/库存/会计/项目/消息与工作流等. 15. 将各类单据的序号重置,从1开始,包括:SO/PO/MO/Invoice 等 16. 修复odoo启用英文后模块不显示中文的Bug 17. 可停用odoo自动订阅功能,避免“同样对象关注2次”bug,同时提升性能 +18. 显示/隐藏应用的作者和网站-在应用安装面板中 +19. 一键清除所有数据(视当前数据情况,有时需点击2次) 使用方法:将解压后的 app_odoo_customize 放到 odoo的 addons目录下,激活开发者模式,应用-->更新应用列表, 找到 "App odoo Customize"模块,安装即可。 diff --git a/app_odoo_customize/security/ir.model.access.csv b/app_odoo_customize/security/ir.model.access.csv new file mode 100644 index 00000000..4277cb36 --- /dev/null +++ b/app_odoo_customize/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_ir_config_parameter_system","ir_config_parameter_system","base.model_ir_config_parameter","base.group_user",1,0,0,0 \ No newline at end of file diff --git a/app_odoo_customize/static/description/cnreadme.png b/app_odoo_customize/static/description/cnreadme.png index d76676e0..441c4b99 100644 Binary files a/app_odoo_customize/static/description/cnreadme.png and b/app_odoo_customize/static/description/cnreadme.png differ diff --git a/app_odoo_customize/static/description/index.html b/app_odoo_customize/static/description/index.html index 565c9e10..8a20325e 100644 --- a/app_odoo_customize/static/description/index.html +++ b/app_odoo_customize/static/description/index.html @@ -1,15 +1,19 @@
-
+

App Odoo Customize

This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher, Online Documentation Access,Quick Data Clear.

-

More Powerful UI addons: - App UI enhance +

Lastest update: v11.0.7.23

+

Fix Login bug when install website.

+

Add 19. One Click to clear all data (Sometime pls click twice)

+

Add 18. Show/Hide Author and Website in Apps Dashboard

+

More Powerful addons: + Sunpop.cn Addons


-

Lastest update: v10.0.2.4, 2018-02-04

+

Add Odoo 11 Support

  • 1. Deletes Odoo label in footer
  • 2. Replaces "Odoo" in Windows title
  • @@ -24,10 +28,13 @@
  • 11. Provide 236 country flags.
  • 12. Multi-language Support.
  • 13. Change Powered by Odoo in login screen.(Please change '../views/app_odoo_customize_view.xml' #15)
  • -
  • 14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Base Models.
  • +
  • 14. Quick delete test data in Apps: Sales/POS/Purchase/MRP/Inventory/Accounting/Project/Base Models.
  • 15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice...
  • 16. Fix odoo reload module translation bug while enable english language
  • 17. Stop Odoo Auto Subscribe(Performance Improve)
  • +
  • 18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only)
  • +
  • 19. One Click to clear all data (Sometime pls click twice)
  • +
  • 20. Set System Icon (odoo 10 only)

This module can help to white label the Odoo. @@ -44,7 +51,7 @@

-
+

Odoo Customize(Debranding Title,Language,Documentation,Quick Debug)

@@ -67,7 +74,7 @@
-
+

How to use: Go to Settings -> odooApp Settings

@@ -78,7 +85,35 @@
-
+
+
+

Set System Icon (odoo 10 only)

+
+
+ +
+
+
+ +
+
+

Show/Hide Author and Website in Apps Dashboard

+
+

Before

+
+ +
+
+

After uncheck "Show Author and Website in Apps Dashboard"

+
+ +
+
+
+ +

Setup more flags: just rename the flag pic to locale code of the country

@@ -90,7 +125,7 @@
-
+

Quick Delete test Data.

diff --git a/app_odoo_customize/static/description/set1.jpg b/app_odoo_customize/static/description/set1.jpg new file mode 100644 index 00000000..8b671010 Binary files /dev/null and b/app_odoo_customize/static/description/set1.jpg differ diff --git a/app_odoo_customize/static/description/set1.png b/app_odoo_customize/static/description/set1.png deleted file mode 100644 index b68f7abe..00000000 Binary files a/app_odoo_customize/static/description/set1.png and /dev/null differ diff --git a/app_odoo_customize/static/description/set18-1.jpg b/app_odoo_customize/static/description/set18-1.jpg new file mode 100644 index 00000000..56c40177 Binary files /dev/null and b/app_odoo_customize/static/description/set18-1.jpg differ diff --git a/app_odoo_customize/static/description/set18-2.jpg b/app_odoo_customize/static/description/set18-2.jpg new file mode 100644 index 00000000..32028d74 Binary files /dev/null and b/app_odoo_customize/static/description/set18-2.jpg differ diff --git a/app_odoo_customize/static/description/set19.jpg b/app_odoo_customize/static/description/set19.jpg new file mode 100644 index 00000000..8bea0b62 Binary files /dev/null and b/app_odoo_customize/static/description/set19.jpg differ diff --git a/app_odoo_customize/static/description/set3.jpg b/app_odoo_customize/static/description/set3.jpg new file mode 100644 index 00000000..d1285f3a Binary files /dev/null and b/app_odoo_customize/static/description/set3.jpg differ diff --git a/app_odoo_customize/static/description/set3.png b/app_odoo_customize/static/description/set3.png deleted file mode 100644 index 0c2edc58..00000000 Binary files a/app_odoo_customize/static/description/set3.png and /dev/null differ diff --git a/app_odoo_customize/static/src/img/flags/flag_syria.png b/app_odoo_customize/static/src/img/flags/ar_SY.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_syria.png rename to app_odoo_customize/static/src/img/flags/ar_SY.png diff --git a/app_odoo_customize/static/src/img/flags/flag_bulgaria.png b/app_odoo_customize/static/src/img/flags/bg.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_bulgaria.png rename to app_odoo_customize/static/src/img/flags/bg.png diff --git a/app_odoo_customize/static/src/img/flags/flag_bosnia_and_herzegovina.png b/app_odoo_customize/static/src/img/flags/bs_BA.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_bosnia_and_herzegovina.png rename to app_odoo_customize/static/src/img/flags/bs_BA.png diff --git a/app_odoo_customize/static/src/img/flags/flag_australia.png b/app_odoo_customize/static/src/img/flags/en_AU.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_australia.png rename to app_odoo_customize/static/src/img/flags/en_AU.png diff --git a/app_odoo_customize/static/src/img/flags/flag_united_kingdom.png b/app_odoo_customize/static/src/img/flags/en_GB.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_united_kingdom.png rename to app_odoo_customize/static/src/img/flags/en_GB.png diff --git a/app_odoo_customize/static/src/img/flags/flag_argentina.png b/app_odoo_customize/static/src/img/flags/es_AR.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_argentina.png rename to app_odoo_customize/static/src/img/flags/es_AR.png diff --git a/app_odoo_customize/static/src/img/flags/flag_bolivia.png b/app_odoo_customize/static/src/img/flags/es_BO.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_bolivia.png rename to app_odoo_customize/static/src/img/flags/es_BO.png diff --git a/app_odoo_customize/static/src/img/flags/flag_chile.png b/app_odoo_customize/static/src/img/flags/es_CL.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_chile.png rename to app_odoo_customize/static/src/img/flags/es_CL.png diff --git a/app_odoo_customize/static/src/img/flags/flag_colombia.png b/app_odoo_customize/static/src/img/flags/es_CO.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_colombia.png rename to app_odoo_customize/static/src/img/flags/es_CO.png diff --git a/app_odoo_customize/static/src/img/flags/flag_costa_rica.png b/app_odoo_customize/static/src/img/flags/es_CR.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_costa_rica.png rename to app_odoo_customize/static/src/img/flags/es_CR.png diff --git a/app_odoo_customize/static/src/img/flags/flag_dominican_republic.png b/app_odoo_customize/static/src/img/flags/es_DO.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_dominican_republic.png rename to app_odoo_customize/static/src/img/flags/es_DO.png diff --git a/app_odoo_customize/static/src/img/flags/flag_ecuador.png b/app_odoo_customize/static/src/img/flags/es_EC.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_ecuador.png rename to app_odoo_customize/static/src/img/flags/es_EC.png diff --git a/app_odoo_customize/static/src/img/flags/es_ES.png~HEAD b/app_odoo_customize/static/src/img/flags/es_ES.png~HEAD deleted file mode 100644 index 0c9580b0..00000000 Binary files a/app_odoo_customize/static/src/img/flags/es_ES.png~HEAD and /dev/null differ diff --git a/app_odoo_customize/static/src/img/flags/es_ES.png~origin_10.0 b/app_odoo_customize/static/src/img/flags/es_ES.png~origin_10.0 deleted file mode 100644 index 0c9580b0..00000000 Binary files a/app_odoo_customize/static/src/img/flags/es_ES.png~origin_10.0 and /dev/null differ diff --git a/app_odoo_customize/static/src/img/flags/flag_guatemala.png b/app_odoo_customize/static/src/img/flags/es_GT.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_guatemala.png rename to app_odoo_customize/static/src/img/flags/es_GT.png diff --git a/app_odoo_customize/static/src/img/flags/flag_mexico.png b/app_odoo_customize/static/src/img/flags/es_MX.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_mexico.png rename to app_odoo_customize/static/src/img/flags/es_MX.png diff --git a/app_odoo_customize/static/src/img/flags/flag_uruguay.png b/app_odoo_customize/static/src/img/flags/es_UY.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_uruguay.png rename to app_odoo_customize/static/src/img/flags/es_UY.png diff --git a/app_odoo_customize/static/src/img/flags/flag_venezuela.png b/app_odoo_customize/static/src/img/flags/es_VE.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_venezuela.png rename to app_odoo_customize/static/src/img/flags/es_VE.png diff --git a/app_odoo_customize/static/src/img/flags/flag_spain.png b/app_odoo_customize/static/src/img/flags/flag_spain.png deleted file mode 100644 index 0c9580b0..00000000 Binary files a/app_odoo_customize/static/src/img/flags/flag_spain.png and /dev/null differ diff --git a/app_odoo_customize/static/src/img/flags/flag_south_korea.png b/app_odoo_customize/static/src/img/flags/ko_KR.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_south_korea.png rename to app_odoo_customize/static/src/img/flags/ko_KR.png diff --git a/app_odoo_customize/static/src/img/flags/flag_brazil.png b/app_odoo_customize/static/src/img/flags/pt_BR.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_brazil.png rename to app_odoo_customize/static/src/img/flags/pt_BR.png diff --git a/app_odoo_customize/static/src/img/flags/flag_albania.png b/app_odoo_customize/static/src/img/flags/sq_AL.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_albania.png rename to app_odoo_customize/static/src/img/flags/sq_AL.png diff --git a/app_odoo_customize/static/src/img/flags/flag_turkey.png b/app_odoo_customize/static/src/img/flags/tr_TR.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_turkey.png rename to app_odoo_customize/static/src/img/flags/tr_TR.png diff --git a/app_odoo_customize/static/src/img/flags/flag_ukraine.png b/app_odoo_customize/static/src/img/flags/uk_UA.png similarity index 100% rename from app_odoo_customize/static/src/img/flags/flag_ukraine.png rename to app_odoo_customize/static/src/img/flags/uk_UA.png diff --git a/app_odoo_customize/static/src/img/icon76red.png b/app_odoo_customize/static/src/img/icon76red.png new file mode 100644 index 00000000..aa490954 Binary files /dev/null and b/app_odoo_customize/static/src/img/icon76red.png differ diff --git a/app_odoo_customize/static/src/img/logo_sunpop.png b/app_odoo_customize/static/src/img/logo_sunpop.png new file mode 100644 index 00000000..90cbe0e2 Binary files /dev/null and b/app_odoo_customize/static/src/img/logo_sunpop.png differ diff --git a/app_odoo_customize/static/src/js/app_window_title.js b/app_odoo_customize/static/src/js/app_window_title.js index b7c368af..8e673b54 100644 --- a/app_odoo_customize/static/src/js/app_window_title.js +++ b/app_odoo_customize/static/src/js/app_window_title.js @@ -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'); diff --git a/app_odoo_customize/static/src/js/customize_user_menu.js b/app_odoo_customize/static/src/js/customize_user_menu.js index 8891bf7e..e6b6787a 100644 --- a/app_odoo_customize/static/src/js/customize_user_menu.js +++ b/app_odoo_customize/static/src/js/customize_user_menu.js @@ -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 = ''; + } else { + a = ''; + } + lang_list += '
  • ' + lang['name'] + a + '
  • '; + }); + lang_list += '
  • '; + $('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); - }); -}) +}); diff --git a/app_odoo_customize/static/src/js/switch_language.js b/app_odoo_customize/static/src/js/switch_language.js deleted file mode 100644 index 2910319f..00000000 --- a/app_odoo_customize/static/src/js/switch_language.js +++ /dev/null @@ -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 = ''; - } else { - a = ''; - } - lang_list += '
  • ' + lang['name'] + a + '
  • '; - }); - lang_list += '
  • '; - $('switch-lang').replaceWith(lang_list); - }); - } - }); - }, 2500); - }); -}); diff --git a/app_odoo_customize/static/src/xml/customize_user_menu.xml b/app_odoo_customize/static/src/xml/customize_user_menu.xml index 52d45cc1..c38be194 100644 --- a/app_odoo_customize/static/src/xml/customize_user_menu.xml +++ b/app_odoo_customize/static/src/xml/customize_user_menu.xml @@ -3,13 +3,13 @@ -
  • +
  • Activate the developer mode
  • -
  • +
  • Activate the developer mode (with assets)
  • -
  • +
  • Deactivate the developer mode
  • diff --git a/app_odoo_customize/views/app_odoo_customize_view.xml b/app_odoo_customize/views/app_odoo_customize_view.xml index d9bb42a9..95e210e5 100644 --- a/app_odoo_customize/views/app_odoo_customize_view.xml +++ b/app_odoo_customize/views/app_odoo_customize_view.xml @@ -4,16 +4,15 @@ - + + + + + \ No newline at end of file diff --git a/app_odoo_customize/views/app_theme_config_settings_view.xml b/app_odoo_customize/views/app_theme_config_settings_view.xml index 2b115b5a..52dbf157 100644 --- a/app_odoo_customize/views/app_theme_config_settings_view.xml +++ b/app_odoo_customize/views/app_theme_config_settings_view.xml @@ -1,5 +1,5 @@ - + App Odoo Customize Settings @@ -60,10 +60,14 @@
  • -
    +
    +
    + +
    @@ -90,21 +94,21 @@