[IMP] Client actions now takes the action as argument. Use action.params for options.

bzr revid: fme@openerp.com-20121105130130-dwkn8124zc6yq933
This commit is contained in:
Fabien Meghazi 2012-11-05 14:01:30 +01:00
parent 6f57449dcd
commit cbbd4dcee3
2 changed files with 11 additions and 9 deletions

View File

@ -123,10 +123,10 @@ openerp.base_import = function (instance) {
this.exit();
}
},
init: function (parent, params) {
init: function (parent, action) {
var self = this;
this._super.apply(this, arguments);
this.res_model = params.model;
this.res_model = action.params.model;
// import object id
this.id = null;
this.Import = new instance.web.Model('base_import.import');

View File

@ -1385,7 +1385,8 @@ openerp.mail = function (session) {
* When you use this option, the domain is not used for the fetch root.
* @param {String} [no_message] Message to display when there are no message
*/
init: function (parent, options) {
init: function (parent, action) {
var options = action.params || {};
this._super(parent);
this.domain = options.domain || [];
this.context = options.context || {};
@ -1513,7 +1514,7 @@ openerp.mail = function (session) {
this.root.destroy();
}
// create and render Thread widget
this.root = new mail.Widget(this, {
this.root = new mail.Widget(this, { params: {
'domain' : domain,
'context' : this.options.context,
'typeof_thread': this.options.context['typeof_thread'] || 'other',
@ -1524,7 +1525,7 @@ openerp.mail = function (session) {
'message_ids': message_ids,
'show_compact_message': true,
'no_message': this.node.attrs.help
}
}}
);
return this.root.replace(this.$('.oe_mail-placeholder'));
@ -1552,9 +1553,10 @@ openerp.mail = function (session) {
* @param {Object} [options.context] context, is an object. It should
* contain default_model, default_res_id, to give it to the threads.
*/
init: function (parent, options) {
init: function (parent, action) {
this._super(parent);
this.options = options || {};
var options = action.params || {};
this.options = options;
this.options.domain = options.domain || [];
this.options.context = options.context || {};
this.search_results = {'domain': [], 'context': {}, 'groupby': {}}
@ -1611,7 +1613,7 @@ openerp.mail = function (session) {
message_render: function (search) {
var domain = this.options.domain.concat(this.search_results['domain']);
var context = _.extend(this.options.context, search&&search.search_results['context'] ? search.search_results['context'] : {});
this.root = new mail.Widget(this, {
this.root = new mail.Widget(this, { params: {
'domain' : domain,
'context' : context,
'typeof_thread': context['typeof_thread'] || 'other',
@ -1620,7 +1622,7 @@ openerp.mail = function (session) {
'show_read_unread_button': 11,
'show_compose_message': true,
'show_compact_message': false,
}
}}
);
return this.root.replace(this.$('.oe_mail-placeholder'));