From d3795a63b157b50fad49d0dc5dbdb3f2bfd41684 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 16 Dec 2011 17:35:40 +0100 Subject: [PATCH] simplify embed code bzr revid: al@openerp.com-20111216163540-o13b84nsrj5kdulu --- addons/share/wizard/share_wizard.py | 20 +++++--------------- addons/share/wizard/share_wizard_view.xml | 2 -- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 4898d7b83f1..0bbbd9bb5a6 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -106,13 +106,6 @@ class share_wizard(osv.osv_memory): result[this.id] = this.share_url_template() % data return result - def _embed_head(self, cr, uid, ids, _fn, _args, context=None): - base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='', context=context) - head = """ - - - """ % (base_url, base_url) - return dict.fromkeys(ids, head) def _embed_code(self, cr, uid, ids, _fn, _args, context=None): result = dict.fromkeys(ids, '') @@ -137,7 +130,6 @@ class share_wizard(osv.osv_memory): 'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"), 'message': fields.text("Personal Message", help="An optional personal message, to be included in the e-mail notification."), - 'embed_head': fields.function(_embed_head, type='text'), 'embed_code': fields.function(_embed_code, type='text'), 'embed_option_title': fields.boolean("Display title"), 'embed_option_search': fields.boolean('Display search view'), @@ -768,7 +760,7 @@ class share_wizard(osv.osv_memory): js_options = {} title = options['title'] if 'title' in options else wizard.embed_option_title search = (options['search'] if 'search' in options else wizard.embed_option_search) if wizard.access_mode != 'readonly' else False - + if not title: js_options['display_title'] = False if search: @@ -780,12 +772,10 @@ class share_wizard(osv.osv_memory): user = wizard.result_line_ids[0] return """ - - """ % { + + """ % { 'init': simplejson.dumps(openerp.conf.server_wide_modules), 'server': simplejson.dumps(base_url), 'dbname': simplejson.dumps(cr.dbname), diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml index fb7544d1e68..4fb5117db6d 100644 --- a/addons/share/wizard/share_wizard_view.xml +++ b/addons/share/wizard/share_wizard_view.xml @@ -75,8 +75,6 @@ - -