From 175d5ff509e66d9d9014a19a6a4493c4a8d1d182 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 25 Jul 2012 14:35:43 +0200 Subject: [PATCH] [IMP] added option "no_open" in m2o bzr revid: nicolas.vanhoren@openerp.com-20120725123543-fzzefu57lwy5xksd --- addons/web/static/src/js/view_form.js | 7 ++++--- addons/web/static/src/xml/base.xml | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 835527b3135..f8f09ae2762 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2818,10 +2818,11 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc if (follow) link += "
"; } - this.$element.find('a') + var $link = this.$element.find('.oe_form_uri') .unbind('click') - .html(link) - .click(function () { + .html(link); + if (! this.get_definition_options().no_open) + $link.click(function () { self.do_action({ type: 'ir.actions.act_window', res_model: self.field.relation, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 5d55a0ece15..4ce36fe86d4 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -955,11 +955,13 @@ - + + - / + /