Merge lp:~openerp-dev/openobject-server/trunk-graph-schemas-fixes-xmo into lp:openobject-server
Status: | Work in progress |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/trunk-graph-schemas-fixes-xmo |
Merge into: | lp:openobject-server |
Diff against target: |
126 lines (+94/-11) 1 file modified
openerp/addons/base/rng/view.rng (+94/-11) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/trunk-graph-schemas-fixes-xmo |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Dony (Odoo) | Pending | ||
Vo Minh Thu | Pending | ||
Review via email: mp+60789@code.launchpad.net |
Description of the change
Tighten the subset of view schemas for the graph view:
* Explicitly specify possible values for arguments of `graph`
* Remove @color, which is unused and unspecified
* Specify `graph/field` as a self-contained element instead of referring to the global catch-all `field`, and specify the possible values for `field/@operator` and `field/@group`.
* Removed value `**` from `field/@operator` (it does not really seem to have any point). `*` might also be on the chopping block, not sure what use it could be apart from a ghetto `and`.
* graph[not(
* Pie charts can't have more than 2 fields anymore
Issue remaining, but I have not found a way to solve it: theoretically, a bar chart should only accept:
* A base field used as the main axis (for grouping on)
* An optional grouping field (field[
* 1..n aggregate fields (for the columns, with an optional @operator)
My idea was to handle the last two cases with interleave and write something like:
(element field {
attribute group { "True" },
& element field {
attribute operator { "+" | "*" | "min" | "max" }?
but it turns out RNG has a restriction against this pattern: you can't interleave elements with the same name.
For now, I've just created a group field, but that means you can put multiple group fields and no aggregate field in a bar graph view, which is not quite optimal.
I have yet to find a solution short of imposing order (e.g. mandating that the grouping field be the last one or the first one in the sequence).
Unmerged revisions
- 3413. By Xavier (Open ERP)
-
[IMP] complete reimplementation of the graph schema, not perfect but hell of a lot better than the old one, methinks
- 3412. By Xavier (Open ERP)
-
[IMP] there is already a named patterns for handling of access rights attribute(s)
- 3411. By Xavier (Open ERP)
-
[FIX] forgot @groups
- 3410. By Xavier (Open ERP)
-
[IMP] extract field definition for graphs, to correctly restrict attribute values
- 3409. By Xavier (Open ERP)
-
[REM] graph/html: unspecified, not clear where how it's supposed to rendering, unused. Reintroduce (correctly specified) if needed
- 3408. By Xavier (Open ERP)
-
[IMP] better specify range of values for graph/@orientation and graph/@type
- 3407. By Xavier (Open ERP)
-
[REM] @color attribute on graph view: unused and unusable
Mmm... this is the kind of stuff that I would like to see merged but are quite hard to get right without looking through the source of the web client. The merge prop doesn't seem complete, for instance it lacks the graph type='line'.