From a9a2356b9ebfbfd7a6424d32fc45acb780560ab5 Mon Sep 17 00:00:00 2001 From: David Beal Date: Tue, 7 Jul 2015 18:28:30 +0200 Subject: [PATCH] [IMP] display button with condition --- help_popup/README.rst | 18 ++++++++++++++---- help_popup/static/src/js/popup_help.js | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/help_popup/README.rst b/help_popup/README.rst index 198795f1..9235d806 100644 --- a/help_popup/README.rst +++ b/help_popup/README.rst @@ -6,7 +6,8 @@ Help Popup =========== This module adds an html help popup on each model action. -Two help fields are added to actions: owner_help and custom_help. +Two help fields are added to actions: owner_help (html widget) +and custom_help. Installation @@ -21,20 +22,29 @@ Configuration Go to the action of your choice to add some help content or put data in some modules. +To display the button which open the popup, owner_help or custom_help field +should be set to any value. + Usage ===== Click on ? button + .. image:: help_popup/static/description/popup.png :alt: License: Help Popup -Known issues / Roadmap -====================== +Alternative +----------- +If you have website module installed, it could be an option +to install help_online instead of this module. + +Help Online is more advanced (allow to end user to add help) +but depends on an other module. +Help popup is more like an embedded help that use power users for end users. -* ... Bug Tracker =========== diff --git a/help_popup/static/src/js/popup_help.js b/help_popup/static/src/js/popup_help.js index 60be3ef8..6d773286 100644 --- a/help_popup/static/src/js/popup_help.js +++ b/help_popup/static/src/js/popup_help.js @@ -12,9 +12,12 @@ openerp.help_popup = function(instance, local) { return true; } $elem.data('click-init', true); + if (self.action.custom_help == '' && self.action.owner_help == '') { + self.$el.find('span.view_help').hide() + } $elem.on('click', function(e) { var params = 'height=650, width=800, location=no, '; - params += 'resizable=yes, menubar=yes, titlebar=Bla'; + params += 'resizable=yes, menubar=yes'; path = self.action.id; my_window = window.open('/report/html/help_popup.tpl_help/' + path, 'Help', params); // allows to back to the window if opened previoulsy