[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.
This commit is contained in:
qsm-odoo
2017-04-11 19:44:38 +02:00
committed by Aaron Bohy
parent 49f7a9f657
commit c24d1f615c
@@ -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;