From 97332bcd6406c177bb6a1f627fb38ae055a26829 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 16 Mar 2015 12:57:49 +0200 Subject: [PATCH] Check existence of a localStorage variable. In browsers without localStorage variable links to viewed records are stored only for current browser session (i.e. until user close browser tab) --- web_last_viewed_records/static/src/js/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_last_viewed_records/static/src/js/main.js b/web_last_viewed_records/static/src/js/main.js index 59efd8d4..2da84b1b 100644 --- a/web_last_viewed_records/static/src/js/main.js +++ b/web_last_viewed_records/static/src/js/main.js @@ -1,4 +1,9 @@ openerp.web_last_viewed_records = function(instance){ + var localStorage = {}; + if (typeof window.localStorage !== "undefined"){ + localStorage = window.localStorage; + } + instance.web.ActionManager.include({ last_viewed_history_var: 'odoo_last_viewed', last_viewed_history_size: 8,