Browse Source

[MIG] web_environment_ribbon: Migration to 11.0

pull/1071/head
xavierjimenez 7 years ago
committed by Dennis Sluijk
parent
commit
4f6c813c10
  1. 15
      web_environment_ribbon/README.rst
  2. 1
      web_environment_ribbon/__init__.py
  3. 6
      web_environment_ribbon/__manifest__.py
  4. 1
      web_environment_ribbon/models/web_environment_ribbon_backend.py
  5. 13
      web_environment_ribbon/static/src/js/ribbon.js

15
web_environment_ribbon/README.rst

@ -1,5 +1,5 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
======================
@ -8,14 +8,6 @@ Web Environment Ribbon
Mark a Test Environment with a red ribbon on the top left corner in every page
.. image:: /web_environment_ribbon/static/description/screenshot.png
:alt: Screenshot
Installation
============
No special setup
Configuration
=============
@ -36,7 +28,7 @@ ribbon will be visible on top left corner of every Odoo backend page
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0
:target: https://runbot.odoo-community.org/runbot/162/11.0
Bug Tracker
===========
@ -56,6 +48,7 @@ Contributors
* Javi Melendez <javimelex@gmail.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Thomas Binsfeld <thomas.binsfeld@acsone.eu>
* Xavier Jiménez <xavier.jimenez@qubiq.es>
Maintainer
----------

1
web_environment_ribbon/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Francesco OpenCode Apruzzese <cescoap@gmail.com>
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2017 Thomas Binsfeld <thomas.binsfeld@acsone.eu>

6
web_environment_ribbon/__manifest__.py

@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Francesco OpenCode Apruzzese <cescoap@gmail.com>
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2017 Thomas Binsfeld <thomas.binsfeld@acsone.eu>
# Copyright 2017 Xavier Jiménez <xavier.jimenez@qubiq.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': "Web Environment Ribbon",
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'category': 'Web',
'author': 'Francesco OpenCode Apruzzese, '
'Tecnativa, '
'Odoo Community Association (OCA)',
'website': 'https://it.linkedin.com/in/francescoapruzzese',
'website': 'https://github.com/OCA/web',
'license': 'AGPL-3',
"depends": [
'web',

1
web_environment_ribbon/models/web_environment_ribbon_backend.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

13
web_environment_ribbon/static/src/js/ribbon.js

@ -2,17 +2,16 @@
Copyright 2015 Javi Melendez <javi.melendez@algios.com>
Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
Copyright 2017 Thomas Binsfeld <thomas.binsfeld@acsone.eu>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
Copyright 2017 Xavier Jiménez <xavier.jimenez@qubiq.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web_environment_ribbon.ribbon', function(require) {
"use strict";
var $ = require('jquery');
var Model = require('web.Model');
var rpc = require('web.rpc');
var core = require('web.core');
var backend_model = new Model('web.environment.ribbon.backend');
// Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
function validStrColour(strToTest) {
if (strToTest === "") { return false; }
@ -32,7 +31,10 @@ core.bus.on('web_client_ready', null, function () {
$('body').append(ribbon);
ribbon.hide();
// Get ribbon data from backend
backend_model.call('get_environment_ribbon').then(
rpc.query({
model: 'web.environment.ribbon.backend',
method: 'get_environment_ribbon',
}).then(
function (ribbon_data) {
// Ribbon name
if (ribbon_data.name && ribbon_data.name != 'False') {
@ -50,5 +52,4 @@ core.bus.on('web_client_ready', null, function () {
}
);
});
}); // odoo.define
Loading…
Cancel
Save