openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #03235
[Merge] lp:~openerp-dev/openobject-client-web/trunk-bug-715485-sma into lp:openobject-client-web
Sananaz (Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/trunk-bug-715485-sma into lp:openobject-client-web.
Requested reviews:
OpenERP SA's Web Client R&D (openerp-dev-web)
Related bugs:
#715485 [PS] Product list view : filter :field stock location give traceback on web-client
https://bugs.launchpad.net/bugs/715485
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-715485-sma/+merge/50556
Hello,
Problem for context {'location': self} which passed on
Extended Filters > Stock Location(location_id) field.
Need to replace `self` with the fields current value, after that evaluate the context.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-715485-sma/+merge/50556
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/trunk-bug-715485-sma.
=== modified file 'addons/openerp/static/javascript/m2o.js'
--- addons/openerp/static/javascript/m2o.js 2011-02-14 05:48:40 +0000
+++ addons/openerp/static/javascript/m2o.js 2011-02-21 07:32:14 +0000
@@ -147,6 +147,7 @@
if(editable && jQuery(this.field).hasClass('readonlyfield')) {
editable = false;
}
+ var context = jQuery(this.field).attr('context').replace(/self/g, "'"+this.text.value +"'")
eval_domain_context_request({
source: source,
domain: domain,
@@ -372,7 +373,7 @@
var m2o = this;
var domain = jQuery(this.field).attr('domain');
- var context = jQuery(this.field).attr('context');
+ var context = jQuery(this.field).attr('context').replace(/self/g, "'"+this.text.value +"'")
eval_domain_context_request({
source: this.name,
@@ -436,7 +437,8 @@
this.lastSearch = this.text.value;
if (this.numResultRows==0) {
var self = this;
- var req = eval_domain_context_request({source: this.name, domain: getNodeAttribute(this.field, 'domain'), context: getNodeAttribute(this.field, 'context')});
+ var context = jQuery(this.field).attr('context').replace(/self/g, "'"+this.text.value +"'")
+ var req = eval_domain_context_request({source: this.name, domain: getNodeAttribute(this.field, 'domain'), context: context});
req.addCallback(function(obj) {
self.eval_domain = obj.domain;
self.eval_context = obj.context
Follow ups