}
return true;
},
- sidebar_context: function () {
- return this.save().then(_.bind(function() {return this.get_fields_values();}, this));
+ sidebar_eval_context: function () {
+ return $.when(this.build_eval_context());
},
open_defaults_dialog: function () {
var self = this;
},
on_item_action_clicked: function(item) {
var self = this;
- self.getParent().sidebar_context().done(function (context) {
+ self.getParent().sidebar_eval_context().done(function (sidebar_eval_context) {
var ids = self.getParent().get_selected_ids();
if (ids.length == 0) {
instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true });
return false;
}
- var additional_context = _.extend({
+ var active_ids_context = {
active_id: ids[0],
active_ids: ids,
active_model: self.getParent().dataset.model
- }, context);
+ };
self.rpc("/web/action/load", {
action_id: item.action.id,
- context: additional_context
+ context: new instance.web.CompoundContext(sidebar_eval_context, active_ids_context),
}).done(function(result) {
- result.context = _.extend(result.context || {},
- additional_context);
+ console.log(result.context);
+ result.context = new instance.web.CompoundContext(result.context || {}, active_ids_context);
result.flags = result.flags || {};
result.flags.new_window = true;
self.do_action(result, {
on_sidebar_export: function() {
new instance.web.DataExport(this, this.dataset).open();
},
- sidebar_context: function () {
+ sidebar_eval_context: function () {
return $.when();
},
/**