Skip to content
Snippets Groups Projects
Commit 82fbb8fb0aed authored by Etienne Ferriere's avatar Etienne Ferriere
Browse files

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,!5Added a method able to return the technical names of all the analytic fields of
......@@ -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."""
......
......@@ -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:
......
......@@ -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
------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment