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
d3fdf50a42a0
Commit
d3fdf50a42a0
authored
1 year ago
by
Houzefa Abbasbhay
Browse files
Options
Downloads
Patches
Plain Diff
Code QoL found by linters
parent
f5c9f411bdef
No related branches found
Branches containing commit
Tags
16.0.1.0.9
Tags containing commit
1 merge request
!22
View fixes, bound dimension fixes, code QoL
Pipeline
#61701
passed
1 year ago
Stage: build
Stage: test
Stage: doc
Stage: deploy
Changes
2
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MetaAnalytic.py
+1
-1
1 addition, 1 deletion
MetaAnalytic.py
models/analytic_structure.py
+7
-7
7 additions, 7 deletions
models/analytic_structure.py
with
8 additions
and
8 deletions
MetaAnalytic.py
+
1
−
1
View file @
d3fdf50a
...
...
@@ -111,7 +111,7 @@
# Generate the fields directly into the nmspc.
all_analytic
=
[]
for
prefix
,
model_name
in
list
(
analytic
.
items
()
)
:
for
prefix
,
model_name
in
analytic
.
items
():
# Analytic fields
all_analytic
.
append
((
model_name
,
prefix
,
"
id
"
))
...
...
This diff is collapsed.
Click to expand it.
models/analytic_structure.py
+
7
−
7
View file @
d3fdf50a
...
...
@@ -228,7 +228,7 @@
src_dim
=
self
.
get_ordering_dimensions
(
model
)
if
dest_model
is
None
or
dest_model
==
model
:
for
slots
in
list
(
src_dim
.
values
()
)
:
for
slots
in
src_dim
.
values
():
for
slot
in
slots
:
dest_slot
=
slot
add_field
()
...
...
@@ -236,7 +236,7 @@
else
:
dest_dim
=
self
.
get_ordering_dimensions
(
dest_model
)
for
dimension
,
slots
in
list
(
src_dim
.
items
()
)
:
for
dimension
,
slots
in
src_dim
.
items
():
if
dimension
in
dest_dim
:
dest_slots
=
dest_dim
[
dimension
]
slots_number
=
len
(
slots
)
...
...
@@ -287,10 +287,10 @@
return
{
ans
.
ordering
:
ans
.
nd_id
.
name
for
ans
in
self
.
get_structures
(
model
)}
@api.model
def
analytic_fields_get
(
self
,
model
,
field
s
,
prefix
=
"
a
"
,
suffix
=
"
id
"
):
def
analytic_fields_get
(
self
,
model
,
field
_get_ret
,
prefix
=
"
a
"
,
suffix
=
"
id
"
):
"""
Set the label values for the analytic fields.
"""
ans_dict
=
self
.
get_dimensions_names
(
model
.
_analytic_name
)
regex
=
r
"
{pre}(\d+)_{suf}
"
.
format
(
pre
=
prefix
,
suf
=
suffix
)
match_fct
=
re
.
compile
(
regex
).
search
...
...
@@ -291,11 +291,11 @@
"""
Set the label values for the analytic fields.
"""
ans_dict
=
self
.
get_dimensions_names
(
model
.
_analytic_name
)
regex
=
r
"
{pre}(\d+)_{suf}
"
.
format
(
pre
=
prefix
,
suf
=
suffix
)
match_fct
=
re
.
compile
(
regex
).
search
matches
=
[
_f
for
_f
in
map
(
match_fct
,
list
(
fields
.
keys
())
)
if
_f
]
matches
=
[
_f
for
_f
in
map
(
match_fct
,
field_get_ret
.
keys
())
if
_f
]
for
match
in
matches
:
field
=
match
.
group
(
0
)
slot
=
match
.
group
(
1
)
...
...
@@ -298,8 +298,8 @@
for
match
in
matches
:
field
=
match
.
group
(
0
)
slot
=
match
.
group
(
1
)
field
s
[
field
][
"
string
"
]
=
ans_dict
.
get
(
field
_get_ret
[
field
][
"
string
"
]
=
ans_dict
.
get
(
"
{0}
"
.
format
(
slot
),
"
{0}{1}
"
.
format
(
prefix
.
upper
(),
slot
)
)
...
...
@@ -303,7 +303,7 @@
"
{0}
"
.
format
(
slot
),
"
{0}{1}
"
.
format
(
prefix
.
upper
(),
slot
)
)
return
field
s
return
field
_get_ret
@api.model
def
analytic_get_view
(
self
,
model
,
view
,
prefix
=
"
a
"
,
suffix
=
"
id
"
,
subfield
=
None
):
...
...
@@ -389,7 +389,7 @@
registry
=
self
.
env
.
registry
return
[
model
for
name
,
model
in
list
(
registry
.
items
()
)
for
name
,
model
in
registry
.
items
()
if
getattr
(
model
,
"
_analytic
"
,
False
)
]
...
...
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