[IMP] web view: remove insert_alias and add active_id, active_model, active_ids into the context for web/action/load
bzr revid: chm@openerp.com-20130204150304-j11944irbcp4o4gf
This commit is contained in:
parent
0d3004e829
commit
c349508149
|
@ -850,7 +850,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
this.$el.find('.oe_view_nocontent').click(function() {
|
||||
create_nocontent.openerpBounce();
|
||||
});
|
||||
this.insert_alias(this.$el.find('.oe_view_nocontent'));
|
||||
}
|
||||
});
|
||||
instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.ListView.List# */{
|
||||
|
|
|
@ -1306,7 +1306,7 @@ instance.web.View = instance.web.Widget.extend({
|
|||
} else if (action_data.type=="action") {
|
||||
return this.rpc('/web/action/load', {
|
||||
action_id: action_data.name,
|
||||
context: instance.web.pyeval.eval('context', context),
|
||||
context: _.extend({'active_model': dataset.model, 'active_ids': dataset.ids, 'active_id': record_id}, instance.web.pyeval.eval('context', context)),
|
||||
do_not_eval: true
|
||||
}).then(handler);
|
||||
} else {
|
||||
|
@ -1395,26 +1395,6 @@ instance.web.View = instance.web.Widget.extend({
|
|||
var attrs = this.fields_view.arch.attrs;
|
||||
return (action in attrs) ? JSON.parse(attrs[action]) : true;
|
||||
},
|
||||
/**
|
||||
* insert alias into the dom
|
||||
*/
|
||||
insert_alias: function ($dom) {
|
||||
var self = this;
|
||||
var context = this.options.action.context || {};
|
||||
if (context && context.help_alias) {
|
||||
new instance.web.Model('mail.alias').call("get_alias", [], {
|
||||
'model': this.options.action.res_model,
|
||||
'alias_defaults': context.help_alias
|
||||
}).then(function (alias_ids) {
|
||||
if (alias_ids.length && alias_ids[0].email.match(/@.+/)) {
|
||||
// alias_ids[0].global
|
||||
var $alias = $(QWeb.render('View.nocontent_alias'));
|
||||
$alias.append('<a href="mailto:' + alias_ids[0].email + '">' + alias_ids[0].email + '</a>');
|
||||
$dom.append($alias);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -1871,9 +1871,4 @@
|
|||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="View.nocontent_alias">
|
||||
<p class="oe_view_nocontent_alias">
|
||||
You can also create documents by sending an email to:
|
||||
</p>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
@ -456,15 +456,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var self = this;
|
||||
if (this.groups.group_by
|
||||
|| !this.options.action
|
||||
|| !this.options.action.help) {
|
||||
|| (!this.options.action.help)) {
|
||||
return;
|
||||
}
|
||||
this.$el.find('table:first').css("position", "absolute");
|
||||
$(QWeb.render('KanbanView.nocontent', { content : this.options.action.help})).insertAfter(this.$('table:first'));
|
||||
$(QWeb.render('KanbanView.nocontent', { content : this.options.action.dynamic_help || this.options.action.help})).insertAfter(this.$('table:first'));
|
||||
this.$el.find('.oe_view_nocontent').click(function() {
|
||||
self.$buttons.openerpBounce();
|
||||
});
|
||||
this.insert_alias(this.$el.find('.oe_view_nocontent_content'));
|
||||
},
|
||||
remove_no_result: function() {
|
||||
this.$el.find('table:first').css("position", false);
|
||||
|
|
Loading…
Reference in New Issue