Browse Source

test controller

pull/149/head
David Beal 10 years ago
parent
commit
324cf5f27a
  1. 1
      help_contextual_popup/__openerp__.py
  2. 6
      help_contextual_popup/model.py
  3. 3
      help_contextual_popup/static/src/js/popup_help.js

1
help_contextual_popup/__openerp__.py

@ -36,5 +36,4 @@
'static/src/xml/popup_help.xml', 'static/src/xml/popup_help.xml',
], ],
'installable': True, 'installable': True,
'auto_install': False,
} }

6
help_contextual_popup/model.py

@ -20,6 +20,7 @@
############################################################################## ##############################################################################
from openerp import models, fields from openerp import models, fields
from openerp.http import Controller, route
class IrActionsActwindow(models.Model): class IrActionsActwindow(models.Model):
@ -29,3 +30,8 @@ class IrActionsActwindow(models.Model):
string="Custom Help", string="Custom Help",
help="Use this field to add custom content for documentation purpose") help="Use this field to add custom content for documentation purpose")
class MyController(Controller):
@route('/help', auth='public')
def handler(self):
return 'blabla'

3
help_contextual_popup/static/src/js/popup_help.js

@ -14,6 +14,9 @@ openerp.help_contextual_popup = function(instance, local) {
$elem.data('click-init', true); $elem.data('click-init', true);
var help_html = ''; var help_html = '';
help_html += '<a href="http://localhost:8069/help" target="_blank" onclick="window.open(this.href,\'nom_Popup\','
help_html += '\'​height=400 , width=400 , location=no , resizable=yes , scrollbars=no\');return false;">'
help_html += '&rarr; Exemple &larr;</a>'
if (self.action.help) { if (self.action.help) {
help_html += '<h3>Odoo Help</h3>' help_html += '<h3>Odoo Help</h3>'
help_html += '<div id="erp_help">' + self.action.help + '</div>'; help_html += '<div id="erp_help">' + self.action.help + '</div>';

Loading…
Cancel
Save