mirror of https://github.com/OCA/web.git
[IMP] Add default 'ribbon.name' configuration parameter
parent
d8837563cc
commit
db707ae89c
|
@ -17,7 +17,11 @@ Installation
|
|||
Configuration
|
||||
=============
|
||||
|
||||
* No special setup
|
||||
* You can change the ribbon's name ("TEST") by editing
|
||||
the default system parameter "ribbon.name"
|
||||
(in the menu Settings > Parameters > System Parameters)
|
||||
To hide the ribbon, set this parameter to "False" or
|
||||
delete it.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
@ -30,7 +34,7 @@ Known issues / Roadmap
|
|||
======================
|
||||
|
||||
* Allow to define in some place (system parameter, configuration file...) the
|
||||
text for the ribbon and the ribbon color.
|
||||
ribbon color.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
],
|
||||
"data": [
|
||||
'view/base_view.xml',
|
||||
'data/ribbon_data.xml',
|
||||
],
|
||||
"update_xml": [],
|
||||
"demo_xml": [],
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Add ribbon name default configuration parameter -->
|
||||
<record id="default_ribbon_name" model="ir.config_parameter">
|
||||
<field name="key">ribbon.name</field>
|
||||
<field name="value">TEST</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -22,13 +22,12 @@ openerp.web_environment_ribbon = function(instance) {
|
|||
ribbon.hide();
|
||||
|
||||
var model = new instance.web.Model('ir.config_parameter');
|
||||
var query = [['key', '=', 'ribbon.name']];
|
||||
var fields = ['value'];
|
||||
var key = 'ribbon.name';
|
||||
|
||||
var res = model.call('search_read', [query, fields]).then(
|
||||
function (result) {
|
||||
if (result.length) {
|
||||
ribbon.html(result[0].value);
|
||||
var res = model.call('get_param', [key]).then(
|
||||
function (name) {
|
||||
if (name && name != 'False') {
|
||||
ribbon.html(name);
|
||||
ribbon.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,9 @@
|
|||
<!-- Add ribbon to page -->
|
||||
<template id="body_with_ribbon_test" name="ribbon_test web.webclient_bootstrap" inherit_id="web.webclient_bootstrap">
|
||||
<xpath expr="//div[@class='openerp openerp_webclient_container']" position="before">
|
||||
<div class="test-ribbon"><b>TEST</b></div>
|
||||
<div class="test-ribbon"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue