}, options || {});
trigger.tipTip(options);
},
- _build_view_fields_values: function() {
+ _build_view_fields_values: function(blacklist) {
var a_dataset = this.view.dataset;
- var fields_values = this.view.get_fields_values();
+ var fields_values = this.view.get_fields_values(blacklist);
var active_id = a_dataset.ids[a_dataset.index];
_.extend(fields_values, {
active_id: active_id || false,
}
return fields_values;
},
- _build_eval_context: function() {
+ _build_eval_context: function(blacklist) {
var a_dataset = this.view.dataset;
- return new openerp.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values());
+ return new openerp.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values(blacklist));
},
/**
* Builds a new context usable for operations related to fields by merging
* the fields'context with the action's context.
*/
- build_context: function() {
+ build_context: function(blacklist) {
var f_context = (this.field || {}).context || {};
- if (!!f_context.__ref) {
- var fields_values = this._build_eval_context();
- f_context = new openerp.web.CompoundDomain(f_context).set_eval_context(fields_values);
+ if (!!f_context.__ref || true) { //TODO: remove true
+ var fields_values = this._build_eval_context(blacklist);
+ f_context = new openerp.web.CompoundContext(f_context).set_eval_context(fields_values);
}
// maybe the default_get should only be used when we do a default_get?
var v_contexts = _.compact([this.node.attrs.default_get || null,
this.node.attrs.context || null]);
var v_context = new openerp.web.CompoundContext();
_.each(v_contexts, function(x) {v_context.add(x);});
- if (_.detect(v_contexts, function(x) {return !!x.__ref;})) {
- var fields_values = this._build_eval_context();
+ if (_.detect(v_contexts, function(x) {return !!x.__ref;}) || true) { //TODO: remove true
+ var fields_values = this._build_eval_context(blacklist);
v_context.set_eval_context(fields_values);
}
// if there is a context on the node, overrides the model's context
var n_domain = this.node.attrs.domain || null;
// if there is a domain on the node, overrides the model's domain
var final_domain = n_domain !== null ? n_domain : f_domain;
- if (!(final_domain instanceof Array)) {
+ if (!(final_domain instanceof Array) || true) { //TODO: remove true
var fields_values = this._build_eval_context();
final_domain = new openerp.web.CompoundDomain(final_domain).set_eval_context(fields_values);
}
this.dataset.child_name = this.name;
//this.dataset.child_name =
this.dataset.on_change.add_last(function() {
- self.on_ui_change();
+ self.trigger_on_change();
});
this.is_setted.then(function() {
self.load_views();
});
},
+ trigger_on_change: function() {
+ var tmp = this.doing_on_change;
+ this.doing_on_change = true;
+ this.on_ui_change();
+ this.doing_on_change = tmp;
+ },
is_readonly: function() {
return this.readonly || this.force_readonly;
},
return commands['delete'](x.id);}));
},
save_any_view: function() {
+ if (this.doing_on_change)
+ return false;
return this.session.synchronized_mode(_.bind(function() {
if (this.viewmanager && this.viewmanager.views && this.viewmanager.active_view &&
this.viewmanager.views[this.viewmanager.active_view] &&
openerp.web.form.One2ManyDataSet = openerp.web.BufferedDataSet.extend({
get_context: function() {
- this.context = this.o2m.build_context();
+ this.context = this.o2m.build_context([this.o2m.name]);
return this.context;
}
});