Farid Ghanchi (OpenERP) has proposed merging
lp:~openerp-dev/openerp-web/trunk-trigger-on_search into lp:openerp-web.
Requested reviews:
OpenERP R&D Web Team (openerp-dev-web)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-trigger-on_search/+merge/129117
Replace callbackenable methods for "on_search".
--
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-trigger-on_search/+merge/129117
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/trunk-trigger-on_search.
=== modified file 'addons/web/static/src/js/search.js'
--- addons/web/static/src/js/search.js 2012-10-06 16:32:38 +0000
+++ addons/web/static/src/js/search.js 2012-10-11 08:46:23 +0000
@@ -783,25 +783,7 @@
this.on_invalid(search.errors);
return;
}
- return this.on_search(search.domains, search.contexts, search.groupbys);
- },
- /**
- * Triggered after the SearchView has collected all relevant domains and
- * contexts.
- *
- * It is provided with an Array of domains and an Array of contexts, which
- * may or may not be evaluated (each item can be either a valid domain or
- * context, or a string to evaluate in order in the sequence)
- *
- * It is also passed an array of contexts used for group_by (they are in
- * the correct order for group_by evaluation, which contexts may not be)
- *
- * @event
- * @param {Array} domains an array of literal domains or domain references
- * @param {Array} contexts an array of literal contexts or context refs
- * @param {Array} groupbys ordered contexts which may or may not have group_by keys
- */
- on_search: function (domains, contexts, groupbys) {
+ return this.trigger('data_search', search.domains, search.contexts, search.groupbys);
},
/**
* Triggered after a validation error in the SearchView fields.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-10-11 00:37:29 +0000
+++ addons/web/static/src/js/view_form.js 2012-10-11 08:46:23 +0000
@@ -4537,7 +4537,7 @@
}
this.searchview = new instance.web.SearchView(this,
this.dataset, false, search_defaults);
- this.searchview.on_search.add(function(domains, contexts, groupbys) {
+ this.searchview.on('data_search', self, function(domains, contexts, groupbys) {
if (self.initial_ids) {
self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]),
contexts, groupbys);
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2012-10-10 11:30:25 +0000
+++ addons/web/static/src/js/views.js 2012-10-11 08:46:23 +0000
@@ -629,7 +629,7 @@
}
this.searchview = new instance.web.SearchView(this, this.dataset, view_id, search_defaults, this.flags.search_view === false);
- this.searchview.on_search.add(this.do_searchview_search);
+ this.searchview.on('data_search', self, this.do_searchview_search);
return this.searchview.appendTo(this.$el.find(".oe_view_manager_view_search"));
},
do_searchview_search: function(domains, contexts, groupbys) {
=== modified file 'addons/web/static/test/search.js'
--- addons/web/static/test/search.js 2012-08-14 15:29:00 +0000
+++ addons/web/static/test/search.js 2012-10-11 08:46:23 +0000
@@ -652,7 +652,7 @@
}
});
var ds, cs, gs;
- view.on_search.add(function (d, c, g) {
+ view.on('data_search', this, function (d, c, g) {
ds = d, cs = c, gs = g;
});
view.appendTo($fix)
@@ -690,7 +690,7 @@
}
}, {dummy: 42});
var ds, cs, gs;
- view.on_search.add(function (d, c, g) {
+ view.on('data_search', this, function (d, c, g) {
ds = d, cs = c, gs = g;
});
view.appendTo($fix)
@@ -718,7 +718,7 @@
}
}, {dummy: 42});
var ds;
- view.on_search.add(function (d) { ds = d; });
+ view.on('data_search', this, function (d) { ds = d; });
view.appendTo($fix)
.always(start)
.fail(function (error) { ok(false, error.message); })
=== modified file 'addons/web_hello/static/openerp/base_hello.js'
--- addons/web_hello/static/openerp/base_hello.js 2012-04-17 12:48:30 +0000
+++ addons/web_hello/static/openerp/base_hello.js 2012-10-11 08:46:23 +0000
@@ -7,7 +7,7 @@
instance.web.SearchView = instance.web.SearchView.extend({
init:function() {
this._super.apply(this,arguments);
- this.on_search.add(function(){console.log('hello');});
+ this.on('data_search', this, function(){console.log('hello');});
}
});
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp