Browse Source
Merge pull request #149 from akretion/8-help-popup
Merge pull request #149 from akretion/8-help-popup
[ADD] help_contextual_popuppull/181/merge
Sylvain LE GAL
9 years ago
15 changed files with 460 additions and 0 deletions
-
86help_popup/README.rst
-
1help_popup/__init__.py
-
44help_popup/__openerp__.py
-
55help_popup/demo/help.xml
-
60help_popup/i18n/fr.po
-
54help_popup/i18n/help_popup.pot
-
35help_popup/model.py
-
40help_popup/report/help.xml
-
13help_popup/report/report.xml
-
BINhelp_popup/static/description/icon.png
-
BINhelp_popup/static/description/popup.png
-
35help_popup/static/src/js/popup_help.js
-
8help_popup/static/src/xml/popup_help.xml
-
18help_popup/views/action_view.xml
-
11help_popup/views/popup_help_view.xml
@ -0,0 +1,86 @@ |
|||||
|
|
||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Help Popup |
||||
|
=========== |
||||
|
|
||||
|
This module adds an html help popup on each model action. |
||||
|
Two help fields are added to actions: enduser_help (html widget) |
||||
|
and advanced_help. |
||||
|
|
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
|
||||
|
It was tested on Odoo 8.0 branch. |
||||
|
|
||||
|
|
||||
|
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, enduser_help or advanced_help field |
||||
|
should be set to any value. |
||||
|
|
||||
|
|
||||
|
Usage |
||||
|
===== |
||||
|
|
||||
|
Click on ? button |
||||
|
|
||||
|
|
||||
|
.. image:: help_popup/static/description/popup.png |
||||
|
:alt: License: Help Popup |
||||
|
|
||||
|
|
||||
|
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 the 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 |
||||
|
=========== |
||||
|
|
||||
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. |
||||
|
In case of trouble, please check there if your issue has already been reported. |
||||
|
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback |
||||
|
`here <https://github.com/OCA/web/issues/new?body=module:%20web%0Aversion:%200.5%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
||||
|
|
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Sylvain Calador <sylvain.calador@akretion.com> |
||||
|
* David Beal <david.beal@akretion.com> |
||||
|
|
||||
|
|
||||
|
Icons |
||||
|
------ |
||||
|
https://www.iconfinder.com/Vecteezy |
||||
|
|
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
.. image:: https://odoo-community.org/logo.png |
||||
|
:alt: Odoo Community Association |
||||
|
:target: https://odoo-community.org |
||||
|
|
||||
|
This module is maintained by the OCA. |
||||
|
|
||||
|
OCA, or the Odoo Community Association, is a nonprofit organization whose |
||||
|
mission is to support the collaborative development of Odoo features and |
||||
|
promote its widespread use. |
||||
|
|
||||
|
To contribute to this module, please visit http://odoo-community.org. |
@ -0,0 +1 @@ |
|||||
|
from . import model |
@ -0,0 +1,44 @@ |
|||||
|
# coding: utf-8 |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Odoo, Open Source Management Solution |
||||
|
# Copyright (C) 2015-TODAY Akretion (<http://www.akretion.com>). |
||||
|
# |
||||
|
# This program is free software: you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU Affero General Public License as |
||||
|
# published by the Free Software Foundation, either version 3 of the |
||||
|
# License, or (at your option) any later version. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU Affero General Public License for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU Affero General Public License |
||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
{ |
||||
|
'name': 'Help Popup', |
||||
|
'version': '0.5', |
||||
|
'author': 'Akretion, Odoo Community Association (OCA)', |
||||
|
'depends': [ |
||||
|
'web', |
||||
|
], |
||||
|
'demo': [], |
||||
|
'website': 'https://www.akretion.com', |
||||
|
'data': [ |
||||
|
'views/popup_help_view.xml', |
||||
|
'views/action_view.xml', |
||||
|
'report/report.xml', |
||||
|
'report/help.xml', |
||||
|
], |
||||
|
'demo': [ |
||||
|
'demo/help.xml', |
||||
|
], |
||||
|
'qweb': [ |
||||
|
'static/src/xml/popup_help.xml', |
||||
|
], |
||||
|
'installable': True, |
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<openerp> |
||||
|
<data noupdate="1"> |
||||
|
|
||||
|
<record id="base.action_partner_form" model="ir.actions.act_window"> |
||||
|
<field name="enduser_help"><![CDATA[ |
||||
|
<b>Hi Odooer,</b> |
||||
|
|
||||
|
<br/> |
||||
|
<br/> |
||||
|
<p> |
||||
|
I'm the field 'enduser_help' in the Customer action model |
||||
|
</p> |
||||
|
<p> |
||||
|
I'm displayed in a Qweb html report |
||||
|
</p> |
||||
|
|
||||
|
<p> |
||||
|
Don't hesitate to customized me with your own words and syntax |
||||
|
</p> |
||||
|
|
||||
|
]]></field> |
||||
|
</record> |
||||
|
</data> |
||||
|
|
||||
|
<data noupdate="0"> |
||||
|
<record id="base.action_partner_form" model="ir.actions.act_window"> |
||||
|
<field name="advanced_help"><![CDATA[ |
||||
|
<b>Hi developers,</b> |
||||
|
|
||||
|
<br/> |
||||
|
<br/> |
||||
|
<p> |
||||
|
I'm the field 'advanced_help' in the customer action also displayed in Qweb report. |
||||
|
</p> |
||||
|
<p> |
||||
|
<b>Akretion</b> wrote these words to explain my main purpose: |
||||
|
<blockquote> |
||||
|
Allows to developers to write documentation on their work. |
||||
|
</blockquote> |
||||
|
</p> |
||||
|
<p> |
||||
|
|
||||
|
</p> |
||||
|
|
||||
|
<p>You can write any html tag. Here is an image with img tag</p> |
||||
|
|
||||
|
<img src="http://www.akretion.com/sites/50443990c3c67e1bf3000004/theme/images/logo.png"/> |
||||
|
|
||||
|
]]></field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,60 @@ |
|||||
|
# Translation of Odoo Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: Odoo Server 8.0\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2015-07-23 13:41+0000\n" |
||||
|
"PO-Revision-Date: 2015-07-23 15:47+0100\n" |
||||
|
"Last-Translator: David BEAL <david.beal@akretion.com>\n" |
||||
|
"Language-Team: \n" |
||||
|
"Language: fr\n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: 8bit\n" |
||||
|
"Plural-Forms: \n" |
||||
|
"X-Generator: Poedit 1.7.5\n" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: model:ir.actions.report.xml,name:help_popup.report_help_popup |
||||
|
msgid "Contextual Help" |
||||
|
msgstr "Aide contextuelle" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: field:ir.actions.act_window,advanced_help:0 |
||||
|
msgid "Custom Help" |
||||
|
msgstr "Aide personnalisée" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: field:ir.actions.act_window,enduser_help:0 |
||||
|
msgid "End User Help" |
||||
|
msgstr "Aide Utilisateurs Finaux" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: view:website:help_popup.tpl_help |
||||
|
msgid "Help from Odoo" |
||||
|
msgstr "Aide d'Odoo" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: view:website:help_popup.tpl_help |
||||
|
msgid "Help from developer" |
||||
|
msgstr "Aide du développeur" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: help:ir.actions.act_window,advanced_help:0 |
||||
|
msgid "" |
||||
|
"Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by developers" |
||||
|
msgstr "" |
||||
|
"Utilisez ce champ pour ajouter du contenu documentaire\n" |
||||
|
"principalement par les développeurs" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: help:ir.actions.act_window,enduser_help:0 |
||||
|
msgid "" |
||||
|
"Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by power users " |
||||
|
msgstr "" |
||||
|
"Utilisez ce champ pour ajouter du contenu documentaire\n" |
||||
|
"principalement par les utilisateurs avancés." |
@ -0,0 +1,54 @@ |
|||||
|
# Translation of Odoo Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# * help_popup |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: Odoo Server 8.0\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2015-07-23 13:41+0000\n" |
||||
|
"PO-Revision-Date: 2015-07-23 13:41+0000\n" |
||||
|
"Last-Translator: <>\n" |
||||
|
"Language-Team: \n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: \n" |
||||
|
"Plural-Forms: \n" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: model:ir.actions.report.xml,name:help_popup.report_help_popup |
||||
|
msgid "Contextual Help" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: field:ir.actions.act_window,advanced_help:0 |
||||
|
msgid "Custom Help" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: field:ir.actions.act_window,enduser_help:0 |
||||
|
msgid "End User Help" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: view:website:help_popup.tpl_help |
||||
|
msgid "Help from Odoo" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: view:website:help_popup.tpl_help |
||||
|
msgid "Help from developer" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: help:ir.actions.act_window,advanced_help:0 |
||||
|
msgid "Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by developers" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: help_popup |
||||
|
#: help:ir.actions.act_window,enduser_help:0 |
||||
|
msgid "Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by power users " |
||||
|
msgstr "" |
||||
|
|
@ -0,0 +1,35 @@ |
|||||
|
# coding: utf-8 |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Odoo, Open Source Management Solution |
||||
|
# Copyright (C) 2015-TODAY Akretion (<http://www.akretion.com>). |
||||
|
# |
||||
|
# This program is free software: you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU Affero General Public License as |
||||
|
# published by the Free Software Foundation, either version 3 of the |
||||
|
# License, or (at your option) any later version. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU Affero General Public License for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU Affero General Public License |
||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp import models, fields |
||||
|
|
||||
|
|
||||
|
class IrActionsActwindow(models.Model): |
||||
|
_inherit = 'ir.actions.act_window' |
||||
|
|
||||
|
enduser_help = fields.Html( |
||||
|
string="End User Help", |
||||
|
help="Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by power users ") |
||||
|
advanced_help = fields.Text( |
||||
|
string="Advanced Help", |
||||
|
help="Use this field to add custom content for documentation purpose\n" |
||||
|
"mainly by developers") |
@ -0,0 +1,40 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<openerp> |
||||
|
<data noupdate="1"> |
||||
|
|
||||
|
<template id="tpl_help"> |
||||
|
|
||||
|
<t t-call="report.html_container"> |
||||
|
<t t-call="report.internal_layout"> |
||||
|
|
||||
|
|
||||
|
<t t-foreach="docs" t-as="o"> |
||||
|
|
||||
|
<div class="page"> |
||||
|
|
||||
|
<div t-raw="o.enduser_help"/> |
||||
|
|
||||
|
<hr width="70%"/> |
||||
|
|
||||
|
<h3 t-if="o.advanced_help">Help from developer</h3> |
||||
|
<div t-raw="o.advanced_help"/> |
||||
|
|
||||
|
<hr width="70%"/> |
||||
|
|
||||
|
<h3 t-if="o.help">Help from Odoo</h3> |
||||
|
<div t-raw="o.help"/> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<!--end foreach--> |
||||
|
</t> |
||||
|
|
||||
|
</t> |
||||
|
</t> |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<report id="report_help_popup" |
||||
|
model="ir.actions.act_window" |
||||
|
string="Contextual Help" |
||||
|
name="help_popup.tpl_help" |
||||
|
report_type="qweb-html"/> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
After Width: 79 | Height: 69 | Size: 1.6 KiB |
After Width: 874 | Height: 793 | Size: 121 KiB |
@ -0,0 +1,35 @@ |
|||||
|
openerp.help_popup = function(instance, local) { |
||||
|
|
||||
|
var _t = instance.web._t; |
||||
|
instance.web.ViewManager.include({ |
||||
|
|
||||
|
do_create_view: function(view_type) { |
||||
|
var self = this; |
||||
|
var res = self._super(view_type); |
||||
|
self.$el.find('span.view_help').each(function () { |
||||
|
var $elem = $(this); |
||||
|
if ($elem.data('click-init')) { |
||||
|
return true; |
||||
|
} |
||||
|
$elem.data('click-init', true); |
||||
|
//alert('ee' + self.action)
|
||||
|
console.log(self.action.id) |
||||
|
if (self.action.id == undefined || (self.action.advanced_help == '' && self.action.enduser_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'; |
||||
|
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
|
||||
|
setTimeout('my_window.focus()', 1); |
||||
|
}); |
||||
|
|
||||
|
return true; |
||||
|
|
||||
|
}); |
||||
|
return res; |
||||
|
}, |
||||
|
}); |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<templates> |
||||
|
<t t-name="ViewManagerAction" t-extend="ViewManagerAction"> |
||||
|
<t t-jquery="h2.oe_view_title" t-operation="before"> |
||||
|
<span> &nbsp; </span><span class="oe_button oe_highlight view_help">?</span> |
||||
|
</t> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_window_action_form" model="ir.ui.view"> |
||||
|
<field name="model">ir.actions.act_window</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="base.view_window_action_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="help" position="after"> |
||||
|
<field name="enduser_help"/> |
||||
|
<field name="advanced_help"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
<template id="assets_backend" name="custom assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" |
||||
|
src="/help_popup/static/src/js/popup_help.js"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue