Merge lp:~openerp-dev/openobject-client-web/trunk-bug-729354-sma into lp:openobject-client-web/trunk

Proposed by Sananaz (Open ERP)
Status: Merged
Approved by: Xavier (Open ERP)
Approved revision: 4608
Merged at revision: 4612
Proposed branch: lp:~openerp-dev/openobject-client-web/trunk-bug-729354-sma
Merge into: lp:openobject-client-web/trunk
Diff against target: 18 lines (+6/-2)
1 file modified
addons/openerp/static/javascript/m2o.js (+6/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/trunk-bug-729354-sma
Reviewer Review Type Date Requested Status
OpenERP R&D Web Team Pending
Review via email: mp+52976@code.launchpad.net

Description of the change

Hello,

It create problem when click on m2o link (In non editable form view m2o value) when this field_name+'_text' is not there.
ex: go at Customer list view just click on row (open in non editable view)
> Click on country field value
> Gives traceback

Thanks.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/openerp/static/javascript/m2o.js'
--- addons/openerp/static/javascript/m2o.js 2011-03-02 09:50:09 +0000
+++ addons/openerp/static/javascript/m2o.js 2011-03-11 07:44:05 +0000
@@ -183,8 +183,12 @@
183 * value of the m2o183 * value of the m2o
184 */184 */
185ManyToOne.prototype.get_context = function () {185ManyToOne.prototype.get_context = function () {
186 return jQuery(this.field).attr('context').replace(186 if (jQuery(this.field).attr('context') != "{}" && this.text) {
187 /\bself\b/g, "'" + this.text.value + "'");187 return jQuery(this.field).attr('context').replace(/\bself\b/g, "'" + this.text.value + "'");
188 }
189 else {
190 return "{}";
191 }
188};192};
189193
190ManyToOne.prototype.on_change = function(evt) {194ManyToOne.prototype.on_change = function(evt) {