diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-03-09 17:04:04 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | c24d1f615ca549ff134fbd250afafc359a591431 (patch) | |
| tree | 883253c7fe89010fb61e84413fcb064c237fa310 /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 49f7a9f657b011080666475f836982665615dc7c (diff) | |
[REF] web: make getContext and getDomain part of dataPoints
Before this commit, the getContext and getDomain functions of a
dataPoint were only available from a BasicModel "get" call result.
As the code is moving towards the creation of a DataPoint class,
these two functions should be a part of the dataPoint itself.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index ab2b7dcbbee..9f2242751e6 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -26,6 +26,8 @@ odoo.define('web.BasicModel', function (require) { * fieldNames: {string[]}, * fields: {Object}, * fieldAttrs: {Object}, + * getContext: {function}, + * getDomain: {function}, * groupedBy: {string[]}, * id: {integer}, * isOpen: {boolean}, @@ -372,9 +374,6 @@ var BasicModel = AbstractModel.extend({ delete element.relation_field; delete element.rawContext; - element.getContext = this._getContext.bind(this, record); - element.getDomain = this._getDomain.bind(this, record); - return element; }, /** @@ -1772,6 +1771,9 @@ var BasicModel = AbstractModel.extend({ value: value, }; + dataPoint.getContext = this._getContext.bind(this, dataPoint); + dataPoint.getDomain = this._getDomain.bind(this, dataPoint); + this.localData[dataPoint.id] = dataPoint; return dataPoint; |
