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
82fbb8fb0aed
Commit
82fbb8fb0aed
authored
3 years ago
by
Etienne Ferriere
Browse files
Options
Downloads
Patches
Plain Diff
Added a method able to return the technical names of all the analytic fields of
a class.
parent
b422df8b2dfe
No related branches found
No related tags found
2 merge requests
!14
🤝 11.0-tomerge
,
!5
Added a method able to return the technical names of all the analytic fields of
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MetaAnalytic.py
+12
-0
12 additions, 0 deletions
MetaAnalytic.py
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
README.rst
+4
-0
4 additions, 0 deletions
README.rst
with
18 additions
and
0 deletions
MetaAnalytic.py
+
12
−
0
View file @
82fbb8fb
...
...
@@ -141,6 +141,18 @@
@AddMethod
(
superclass
)
@api.model
def
get_analytic_field_names
(
self
):
field_names
=
[]
analytic_osv
=
self
.
env
[
"
analytic.structure
"
]
for
model_name
,
prefix
,
suffix
in
all_analytic
:
for
ordering
in
analytic_osv
.
get_dimensions_names
(
model_name
):
field_names
.
append
(
"
%s%s_%s
"
%
(
prefix
,
ordering
,
suffix
))
return
field_names
@AddMethod
(
superclass
)
@api.model
def
fields_get
(
self
,
allfields
=
None
,
attributes
=
None
):
"""
Override this method to rename analytic fields.
"""
...
...
This diff is collapsed.
Click to expand it.
NEWS.rst
+
2
−
0
View file @
82fbb8fb
...
...
@@ -12,6 +12,8 @@
- code_name
- code_description
- parent_column
Added a method able to return the technical names of all the analytic fields of
a class.
.. _2.2:
...
...
This diff is collapsed.
Click to expand it.
README.rst
+
4
−
0
View file @
82fbb8fb
...
...
@@ -101,6 +101,10 @@
.. _AnalyticFields:
This metaclass adds a method able to return the technical names of all the
analytic fields of the inheriting class:
.. get_analytic_field_names
Add analytic fields to a model
------------------------------
...
...
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