This commit is contained in:
ivan deng
2019-01-20 17:52:46 +08:00
parent 1b9649dbfe
commit 53f35afa33
8 changed files with 52 additions and 39 deletions

View File

@@ -23,7 +23,7 @@
{
'name': 'App Odoo Customize(Backend Debranding Title,Language,Documentation,Quick Debug,Clear Data)',
'version': '12.19.1.06',
'version': '12.19.1.20',
'author': 'Sunpop.cn',
'category': 'Productivity',
'website': 'http://www.sunpop.cn',

View File

@@ -10,7 +10,6 @@ _logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
_description = u"App Odoo Customize settings"
app_system_name = fields.Char('System Name', help=u"Setup System Name,which replace Odoo")
app_show_lang = fields.Boolean('Show Quick Language Switcher',
help=u"When enable,User can quick switch language in user menu")
@@ -35,28 +34,29 @@ class ResConfigSettings(models.TransientModel):
@api.model
def get_values(self):
ir_config = self.env['ir.config_parameter']
app_system_name = ir_config.sudo().get_param('app_system_name', default='odooApp')
res = super(ResConfigSettings, self).get_values()
ir_config = self.env['ir.config_parameter'].sudo()
app_system_name = ir_config.get_param('app_system_name', default='odooApp')
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_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_documentation_url = ir_config.sudo().get_param('app_documentation_url',
app_documentation_url = ir_config.get_param('app_documentation_url',
default='http://www.sunpop.cn/documentation/user/12.0/en/index.html')
app_documentation_dev_url = ir_config.sudo().get_param('app_documentation_dev_url',
app_documentation_dev_url = ir_config.get_param('app_documentation_dev_url',
default='http://www.sunpop.cn/documentation/12.0/index.html')
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_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/')
res.update(
app_system_name=app_system_name,
app_show_lang=app_show_lang,
app_show_debug=app_show_debug,
@@ -75,11 +75,12 @@ class ResConfigSettings(models.TransientModel):
app_account_title=app_account_title,
app_account_url=app_account_url
)
return res
@api.multi
def set_values(self):
self.ensure_one()
ir_config = self.env['ir.config_parameter']
super(ResConfigSettings, self).set_values()
ir_config = self.env['ir.config_parameter'].sudo()
ir_config.set_param("app_system_name", self.app_system_name or "")
ir_config.set_param("app_show_lang", self.app_show_lang or "False")
ir_config.set_param("app_show_debug", self.app_show_debug or "False")
@@ -91,7 +92,6 @@ class ResConfigSettings(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/12.0/en/index.html")
@@ -101,8 +101,6 @@ class ResConfigSettings(models.TransientModel):
ir_config.set_param("app_account_title", self.app_account_title or "My Online Account")
ir_config.set_param("app_account_url", self.app_account_url or "http://www.sunpop.cn/my-account/")
return True
@api.multi
def remove_sales(self):
to_removes = [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 175 KiB

View File

@@ -6,6 +6,8 @@
<p>This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher,
Online Documentation Access,Quick Data Clear. </p>
<p>Support Odoo 12, 11, 10, 9. Including communicate and enterprise version. </p>
<h3>Update: v12.19.1.20</h3>
<p>Fix bug: Save config error.</p>
<h3>Update: v12.19.1.05</h3>
<p>Fix bug: If you install Muk moudle, odooapp customize would pop error like "attachment_location". Sometime you need to uninstall this app and restart odoo, install again to take affect.</p>
<h3>Update: v12.0.12.25</h3>

View File

@@ -1,5 +0,0 @@
.o_user_menu .dropdown-menu img,
.o_user_menu_mobile .dropdown-item img {
height: 20px;
margin: 2px;
}

View File

@@ -3,3 +3,11 @@
height: 20px;
margin: 2px;
}
.oe_form_configuration {
.o_settings_container {
span {
display:inline-block;
}
}
}

View File

@@ -102,22 +102,22 @@
<div class="mt16 o_settings_container" name="data-clean">
<h2 name="data-clean" class="o_horizontal_separator">Data Cleaning (Be careful to do that!)</h2>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Sale</span>
<span class="col-3 col-lg-2 text-left">Sale</span>
<button string="Delete All Sales Order" type="object" name="remove_sales"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">POS</span>
<span class="col-3 col-lg-2 text-left">POS</span>
<button string="Delete All POS Order" type="object" name="remove_pos" confirm="Please confirm to delete the select data?"
class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Purchase</span>
<span class="col-3 col-lg-2 text-left">Purchase</span>
<button string="Delete All Purchase Order and Requisition" type="object" name="remove_purchase"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">MRP</span>
<span class="col-3 col-lg-2 text-left">MRP</span>
<button string="Delete All Manufacturing Order" type="object" name="remove_mrp"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
@@ -125,12 +125,12 @@
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Inventory</span>
<span class="col-3 col-lg-2 text-left">Inventory</span>
<button string="Delete All Move/Picking/Package/Lot" type="object" name="remove_inventory"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Accounting</span>
<span class="col-3 col-lg-2 text-left">Accounting</span>
<button string="Delete All Voucher/Invoice/Bill" type="object" name="remove_account"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
@@ -138,12 +138,12 @@
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Project</span>
<span class="col-3 col-lg-2 text-left">Project</span>
<button string="Delete All Project/Task/Forecast" type="object" name="remove_project"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">Base Models</span>
<span class="col-3 col-lg-2 text-left">Base Models</span>
<button string="Delete All Product" type="object" name="remove_product"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
@@ -157,7 +157,7 @@
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>
<div class="col-12 col-lg-12 mb4">
<span class="btn btn-default col-3 col-lg-2 text-left">All Business</span>
<span class="col-3 col-lg-2 text-left">All Business</span>
<button string="Delete All MRP/Sale/Purchase/Account/MRP/Inventory/Project/Message/Workflow" type="object" name="remove_all_biz"
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
</div>

View File

@@ -1,6 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Modules -->
<record id="app_module_tree" model="ir.ui.view">
<field name="name">app.ir.module.module.form</field>
<field name="model">ir.module.module</field>
<field name="inherit_id" ref="base.module_tree" />
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="groups"/>
</field>
</field>
</record>
<record id="app_module_form" model="ir.ui.view">
<field name="name">app.ir.module.module.form</field>
<field name="model">ir.module.module</field>