summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/widgets/debug_manager_tests.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-04-09 14:32:37 +0200
committerGéry Debongnie <ged@odoo.com>2018-04-10 17:41:12 +0200
commit8dbc1d95c36b18398c7284eddda2fe48842a8904 (patch)
tree35c0de6d39b5ecbcd1c77437c5408fa4f8b6a849 /addons/web/static/tests/widgets/debug_manager_tests.js
parent36b4468d15bf96de097cfc3d7e2d5f99febb984b (diff)
[IMP] web: many2one as measure in graph & pivot only when desirable
With this commit, the fields many2one are not always measures in pivot and graph views. By default, they are *not* measures. In order to have them as measures, we should pass `additionalMeasures` as a param to any of the views, which contains a list of fields to consider as measures. example: Suppose a model with the following fields: - `product_id` (many2one) - `categ_id` (many2one) - `sold` (float) By default, only the field `sold` is a measure in a graph or pivot view. In order to pass `product_id` as a measure of a graph view, you should instantiate this view as follow: `` var viewInfo = /* ... */; var params = { additionalMeasures = ['product_id'], }; var graph = new GraphView(viewInfo, params); `` An exception to the rule above is when the many2one field is of type `measure` in the arch: this field is set as the default measure of the view, therefore it is implicitly added as an additional measure.
Diffstat (limited to 'addons/web/static/tests/widgets/debug_manager_tests.js')
0 files changed, 0 insertions, 0 deletions