From 4cda7ca176d747e1246a00c4e93a0472f4225843 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Wed, 22 Mar 2017 14:14:35 +0100
Subject: [PATCH 1/7] add session name in ribbon

---
 web_environment_ribbon/static/src/js/ribbon.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/web_environment_ribbon/static/src/js/ribbon.js b/web_environment_ribbon/static/src/js/ribbon.js
index 90015ad829ca..6b00fe6cacee 100644
--- a/web_environment_ribbon/static/src/js/ribbon.js
+++ b/web_environment_ribbon/static/src/js/ribbon.js
@@ -9,7 +9,8 @@ odoo.define('web_environment_ribbon.ribbon', function(require) {
 var $ = require('jquery');
 var Model = require('web.Model');
 var core = require('web.core');
-
+var session = require('web.session');
+   
 var model = new Model('ir.config_parameter');
 
 // Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
@@ -33,6 +34,7 @@ core.bus.on('web_client_ready', null, function () {
     model.call('get_param', ['ribbon.name']).then(
         function (name) {
             if (name && name != 'False') {
+                name = _.str.sprintf("%s<br>(%s)", name, session.db);
                 ribbon.html(name);
                 ribbon.show();
             }

From 62ea4cce28897b8f4a43ae9d86a16a1129ab1bb3 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Wed, 22 Mar 2017 14:17:12 +0100
Subject: [PATCH 2/7] add session name in ribbon

---
 web_environment_ribbon/static/src/css/ribbon.css | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/web_environment_ribbon/static/src/css/ribbon.css b/web_environment_ribbon/static/src/css/ribbon.css
index 999c64f7cf97..2e8d7757e2a1 100644
--- a/web_environment_ribbon/static/src/css/ribbon.css
+++ b/web_environment_ribbon/static/src/css/ribbon.css
@@ -2,11 +2,12 @@
  * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
 
 .test-ribbon{
-    width: 200px;
+    width: 300px;
     top: 25px;
-    left: -50px;
+    left: -100px;
     text-align: center;
-    line-height: 50px;
+    padding: 10px;
+    line-height: 20px;
     letter-spacing: 1px;
     color: #f0f0f0;
     -webkit-transform: rotate(-45deg);

From 8b03f663d2084c30b03a176b34b9ab041bf83140 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Tue, 28 Mar 2017 23:09:28 +0200
Subject: [PATCH 3/7] Create __init__.py

---
 web_environment_ribbon/models/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 web_environment_ribbon/models/__init__.py

diff --git a/web_environment_ribbon/models/__init__.py b/web_environment_ribbon/models/__init__.py
new file mode 100644
index 000000000000..07f672352f85
--- /dev/null
+++ b/web_environment_ribbon/models/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# © 2017 Xavier Brochard
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
+
+from . import ribbon

From 2f797d462250e91e1032c2f3048f2b31a187d9c4 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Tue, 28 Mar 2017 23:17:25 +0200
Subject: [PATCH 4/7] Create ribbon.py

---
 web_environment_ribbon/models/ribbon.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 web_environment_ribbon/models/ribbon.py

diff --git a/web_environment_ribbon/models/ribbon.py b/web_environment_ribbon/models/ribbon.py
new file mode 100644
index 000000000000..0ebda4982769
--- /dev/null
+++ b/web_environment_ribbon/models/ribbon.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+# © 2017 Xavier Brochard
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
+
+import os
+from odoo import models
+
+# brouillon OCA/server-tools/blob/10.0/auto_backup/models/db_backup.py
+class DbName(models.Model):
+    folder = fields.Char(
+        default=lambda self: self._default_name(),
+        help='Text printed on the Ribbon',
+        required=True
+    )
+    @api.model
+    def _default_name(self):
+        """Default to database name."""
+        return self.env.cr.dbname

From 5d3b2ac03e476bd87e4238196575e77edcd77766 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Tue, 28 Mar 2017 23:22:22 +0200
Subject: [PATCH 5/7] Update ribbon.py

---
 web_environment_ribbon/models/ribbon.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web_environment_ribbon/models/ribbon.py b/web_environment_ribbon/models/ribbon.py
index 0ebda4982769..230784dbe31a 100644
--- a/web_environment_ribbon/models/ribbon.py
+++ b/web_environment_ribbon/models/ribbon.py
@@ -7,7 +7,7 @@
 
 # brouillon OCA/server-tools/blob/10.0/auto_backup/models/db_backup.py
 class DbName(models.Model):
-    folder = fields.Char(
+    ribbon.name = fields.Char(
         default=lambda self: self._default_name(),
         help='Text printed on the Ribbon',
         required=True

From b4565e4e816d173ccdb089951fd78933d90b83b4 Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Wed, 5 Apr 2017 11:09:10 +0200
Subject: [PATCH 6/7] Update ribbon.py

---
 web_environment_ribbon/models/ribbon.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/web_environment_ribbon/models/ribbon.py b/web_environment_ribbon/models/ribbon.py
index 230784dbe31a..22b6d5bd042c 100644
--- a/web_environment_ribbon/models/ribbon.py
+++ b/web_environment_ribbon/models/ribbon.py
@@ -7,6 +7,7 @@
 
 # brouillon OCA/server-tools/blob/10.0/auto_backup/models/db_backup.py
 class DbName(models.Model):
+    
     ribbon.name = fields.Char(
         default=lambda self: self._default_name(),
         help='Text printed on the Ribbon',
@@ -15,4 +16,4 @@ class DbName(models.Model):
     @api.model
     def _default_name(self):
         """Default to database name."""
-        return self.env.cr.dbname
+        return self.env.cr.dbname()

From 5baa3438e5962664a7694e131fbbfc977fd813dc Mon Sep 17 00:00:00 2001
From: zeroheure <xavier@alternatif.org>
Date: Wed, 5 Apr 2017 11:10:43 +0200
Subject: [PATCH 7/7] Update ribbon.py

---
 web_environment_ribbon/models/ribbon.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/web_environment_ribbon/models/ribbon.py b/web_environment_ribbon/models/ribbon.py
index 22b6d5bd042c..cc9d5778bc5f 100644
--- a/web_environment_ribbon/models/ribbon.py
+++ b/web_environment_ribbon/models/ribbon.py
@@ -3,9 +3,8 @@
 # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
 
 import os
-from odoo import models
+from odoo import models, fields
 
-# brouillon OCA/server-tools/blob/10.0/auto_backup/models/db_backup.py
 class DbName(models.Model):
     
     ribbon.name = fields.Char(
