← Back to team overview

openerp-dev-web team mailing list archive

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

 

Sananaz (Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/trunk-bug-729354-sma into lp:openobject-client-web.

Requested reviews:
  OpenERP SA's Web Client R&D (openerp-dev-web)
Related bugs:
  Bug #729354 in OpenERP Web Client: "[trunk] ManyToOne().open_record() JS function on 'onclick' action doesn't work"
  https://bugs.launchpad.net/openobject-client-web/+bug/729354

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-729354-sma/+merge/52976

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.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-729354-sma/+merge/52976
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/trunk-bug-729354-sma.
=== 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 @@
  * value of the m2o
  */
 ManyToOne.prototype.get_context = function () {
-    return jQuery(this.field).attr('context').replace(
-            /\bself\b/g, "'" + this.text.value + "'");
+    if (jQuery(this.field).attr('context') != "{}" && this.text) {
+    	return jQuery(this.field).attr('context').replace(/\bself\b/g, "'" + this.text.value + "'");
+    }
+    else {
+    	return "{}";
+    }
 };
 
 ManyToOne.prototype.on_change = function(evt) {


Follow ups