Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Analytic Structure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Analytic Structure
Commits
9c11356ed99b
Commit
9c11356ed99b
authored
9 years ago
by
Brendan Masson
Browse files
Options
Downloads
Patches
Plain Diff
Update README
parent
c1f6a8e754c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.rst
+41
-3
41 additions, 3 deletions
README.rst
with
41 additions
and
3 deletions
README.rst
+
41
−
3
View file @
9c11356e
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
---------------------------
---------------------------
You cannot delete analytic codes that are referenced by objects.
You cannot delete analytic codes that are referenced by objects.
Moreover, you cannot delete objects that reference analytic codes that are referenced elsewhere
.
The goal of this constraint is to ensure the integrity of your analyses
.
.. _ConfigureAnalyticFields:
.. _ConfigureAnalyticFields:
...
@@ -81,8 +81,6 @@
...
@@ -81,8 +81,6 @@
translate (False): enable or disable the translation of field values on
translate (False): enable or disable the translation of field values on
analytic dimensions (name) and codes (name and description).
analytic dimensions (name) and codes (name and description).
.. _MetaAnalytic:
.. _MetaAnalytic:
Add the MetaAnalytic metaclass to a model
Add the MetaAnalytic metaclass to a model
...
@@ -167,6 +165,46 @@
...
@@ -167,6 +165,46 @@
}"/>
}"/>
Advanced: Para-analytic fields
------------------------------
Para-analytic fields are a more advanced feature of analytic_structure.
They differ from ordinary analytics fields in two ways:
- They are entirely configurable, meaning that you decide their type and parameters
- They don't have predefined behaviors
Para-analytic fields are defined in with the ``_para_analytic`` attribute.
For each entry in ``_para_analytic`` the ``MetaAnalytic`` metaclass will create a number fields.
The number of fields depend on ``analytic_size`` in the configuration file (see ConfigureAnalyticFields_).
Each entry is key-value pair of a dict where the key is a (prefix, suffix) tuple and the value a dict containing the following:
``model`` the name of the referenced dimension model (doesn't do anything special)
``type`` a field class, the field type to use
``default`` default value for the fields
``args`` list of arguments to inject in ``type`` constructor
``kwargs`` dict of keyword arguments to inject in ``type`` constructor.
Here is declaration that will create fields with the names ``a1_b``, ``a2_b``, ``a3_b``, ...
.. code:: python
from openerp import fields
# ...
# Inside a class
_para_analytic = {
('a', 'b'): {
'model': 'account_move_line',
'type': fields.Boolean,
'default': True,
'args': ("field is optional"),
'kwargs': dict(required=True),
a,}
}
Validation hook for analytic fields
Validation hook for analytic fields
-----------------------------------
-----------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment