diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-06-28 16:04:18 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-06-28 16:04:18 +0200 |
| commit | 58e236eb44373db70a92d99ca32f71ae9178d8f9 (patch) | |
| tree | eb22b1357fb1d15e77c6266809b587975976c861 /addons/base/static/src/js | |
| parent | bbd9df8fc40995c42d47f87b85e40e9cda728051 (diff) | |
[fix] redesigned evaluation contexts
bzr revid: nicolas.vanhoren@openerp.com-20110628140418-lxmclab51ll0iwdd
Diffstat (limited to 'addons/base/static/src/js')
| -rw-r--r-- | addons/base/static/src/js/data.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index d9b2ca752c2..9f5792bfb24 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -597,10 +597,7 @@ openerp.base.CompoundContext = function() { }); }; openerp.base.CompoundContext.prototype.add = function(context) { - if (context.__ref === "compound_context") - this.__contexts = this.__contexts.concat(context.__contexts); - else - this.__contexts.push(context); + this.__contexts.push(context); return this; }; openerp.base.CompoundContext.prototype.set_eval_context = function(eval_context) { @@ -614,17 +611,22 @@ openerp.base.CompoundContext.prototype.get_eval_context = function() { openerp.base.CompoundDomain = function() { this.__ref = "compound_domain"; this.__domains = []; + this.__eval_context = null; _.each(arguments, function(x) { self.add(x); }); }; openerp.base.CompoundDomain.prototype.add = function(domain) { - if (domain.__ref === "compound_domain") - this.__domains = this.__domains.concat(domain.__domains); - else - this.__domains.push(domain); + this.__domains.push(domain); + return this; +}; +openerp.base.CompoundDomain.prototype.set_eval_context = function(eval_context) { + this.__eval_context = eval_context; return this; }; +openerp.base.CompoundDomain.prototype.get_eval_context = function() { + return this.__eval_context; +}; }; |
