Browse Source

[FIX] field name and add translation

pull/149/head
David Beal 9 years ago
parent
commit
0af08e75f1
  1. 6
      help_popup/README.rst
  2. 8
      help_popup/demo/help.xml
  3. 60
      help_popup/i18n/fr.po
  4. 54
      help_popup/i18n/help_popup.pot
  5. 12
      help_popup/model.py
  6. 6
      help_popup/report/help.xml
  7. 2
      help_popup/static/src/js/popup_help.js
  8. 4
      help_popup/views/action_view.xml

6
help_popup/README.rst

@ -6,8 +6,8 @@ Help Popup
===========
This module adds an html help popup on each model action.
Two help fields are added to actions: owner_help (html widget)
and custom_help.
Two help fields are added to actions: enduser_help (html widget)
and advanced_help.
Installation
@ -22,7 +22,7 @@ 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
To display the button which open the popup, enduser_help or advanced_help field
should be set to any value.

8
help_popup/demo/help.xml

@ -4,13 +4,13 @@
<data noupdate="1">
<record id="base.action_partner_form" model="ir.actions.act_window">
<field name="owner_help"><![CDATA[
<field name="enduser_help"><![CDATA[
<b>Hi Odooer,</b>
<br/>
<br/>
<p>
I'm the field 'owner_help' in the Customer action model
I'm the field 'enduser_help' in the Customer action model
</p>
<p>
I'm displayed in a Qweb html report
@ -26,13 +26,13 @@ Don't hesitate to customized me with your own words and syntax
<data noupdate="0">
<record id="base.action_partner_form" model="ir.actions.act_window">
<field name="custom_help"><![CDATA[
<field name="advanced_help"><![CDATA[
<b>Hi developers,</b>
<br/>
<br/>
<p>
I'm the field 'custom_help' in the customer action also displayed in Qweb report.
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:

60
help_popup/i18n/fr.po

@ -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."

54
help_popup/i18n/help_popup.pot

@ -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 ""

12
help_popup/model.py

@ -25,11 +25,11 @@ from openerp import models, fields
class IrActionsActwindow(models.Model):
_inherit = 'ir.actions.act_window'
owner_help = fields.Html(
string="Owner Help",
enduser_help = fields.Html(
string="End User Help",
help="Use this field to add custom content for documentation purpose\n"
"mainly for the ERP owner")
custom_help = fields.Text(
string="Custom Help",
"mainly by power users ")
advanced_help = fields.Text(
string="Advanced Help",
help="Use this field to add custom content for documentation purpose\n"
"mainly for module developers")
"mainly by developers")

6
help_popup/report/help.xml

@ -13,12 +13,12 @@
<div class="page">
<div t-raw="o.owner_help"/>
<div t-raw="o.enduser_help"/>
<hr width="70%"/>
<h3 t-if="o.custom_help">Help from developer</h3>
<div t-raw="o.custom_help"/>
<h3 t-if="o.advanced_help">Help from developer</h3>
<div t-raw="o.advanced_help"/>
<hr width="70%"/>

2
help_popup/static/src/js/popup_help.js

@ -14,7 +14,7 @@ openerp.help_popup = function(instance, local) {
$elem.data('click-init', true);
//alert('ee' + self.action)
console.log(self.action.id)
if (self.action.id == undefined || (self.action.custom_help == '' && self.action.owner_help == '')) {
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) {

4
help_popup/views/action_view.xml

@ -8,8 +8,8 @@
ref="base.view_window_action_form"/>
<field name="arch" type="xml">
<field name="help" position="after">
<field name="owner_help"/>
<field name="custom_help"/>
<field name="enduser_help"/>
<field name="advanced_help"/>
</field>
</field>
</record>

Loading…
Cancel
Save