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
d11003bb260b
Commit
d11003bb260b
authored
6 years ago
by
Houzefa Abbasbhay
Browse files
Options
Downloads
Patches
Plain Diff
Bound analytic codes: Bypass security rules
Behind-the-scenes objects; main object security rules are enough.
parent
924a771ece9d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MetaAnalytic.py
+15
-6
15 additions, 6 deletions
MetaAnalytic.py
with
15 additions
and
6 deletions
MetaAnalytic.py
+
15
−
6
View file @
d11003bb
...
@@ -434,7 +434,8 @@
...
@@ -434,7 +434,8 @@
# inherits.
# inherits.
code_obj
=
self
.
env
[
'
analytic.code
'
]
code_obj
=
self
.
env
[
'
analytic.code
'
]
code_vals
[
'
nd_id
'
]
=
self
.
_get_bound_dimension_id
()
code_vals
[
'
nd_id
'
]
=
self
.
_get_bound_dimension_id
()
code
=
code_obj
.
create
(
code_vals
)
# These are behind-the-scenes links so bypass security rules.
code
=
code_obj
.
sudo
().
create
(
code_vals
)
vals
[
column
]
=
code
.
id
vals
[
column
]
=
code
.
id
new_code
=
code
new_code
=
code
...
@@ -497,7 +498,8 @@
...
@@ -497,7 +498,8 @@
self
.
_generate_code_ref_id
(
res
)
self
.
_generate_code_ref_id
(
res
)
if
new_code
:
if
new_code
:
new_code
.
write
({
# These are behind-the-scenes links so bypass security rules.
new_code
.
sudo
().
write
({
'
origin_id
'
:
'
{},{}
'
.
format
(
self
.
_name
,
res
.
id
),
'
origin_id
'
:
'
{},{}
'
.
format
(
self
.
_name
,
res
.
id
),
})
})
...
@@ -574,8 +576,11 @@
...
@@ -574,8 +576,11 @@
rec_code_vals
[
'
nd_id
'
]
=
rec
.
_get_bound_dimension_id
()
rec_code_vals
[
'
nd_id
'
]
=
rec
.
_get_bound_dimension_id
()
rec_code_vals
[
'
origin_id
'
]
=
\
rec_code_vals
[
'
origin_id
'
]
=
\
'
{},{}
'
.
format
(
self
.
_name
,
rec
.
id
)
'
{},{}
'
.
format
(
self
.
_name
,
rec
.
id
)
rec_vals
[
column
]
=
code_obj
.
create
(
rec_code_vals
).
id
# These are behind-the-scenes links so bypass security
# rules.
rec_vals
[
column
]
=
(
code_obj
.
sudo
()
.
create
(
rec_code_vals
)).
id
super
(
superclass
,
rec
).
write
(
rec_vals
,
**
kwargs
)
super
(
superclass
,
rec
).
write
(
rec_vals
,
**
kwargs
)
elif
rec_code_vals
:
elif
rec_code_vals
:
...
@@ -578,8 +583,10 @@
...
@@ -578,8 +583,10 @@
super
(
superclass
,
rec
).
write
(
rec_vals
,
**
kwargs
)
super
(
superclass
,
rec
).
write
(
rec_vals
,
**
kwargs
)
elif
rec_code_vals
:
elif
rec_code_vals
:
code
.
write
(
rec_code_vals
)
# These are behind-the-scenes links so bypass security
# rules.
code
.
sudo
().
write
(
rec_code_vals
)
if
code_ref_ids
and
news
is
not
False
:
if
code_ref_ids
and
news
is
not
False
:
for
new
in
news
:
for
new
in
news
:
...
@@ -604,7 +611,8 @@
...
@@ -604,7 +611,8 @@
res
=
super
(
superclass
,
self
).
unlink
()
res
=
super
(
superclass
,
self
).
unlink
()
codes
.
unlink
(
**
kwargs
)
# These are behind-the-scenes links so bypass security rules.
codes
.
sudo
().
unlink
(
**
kwargs
)
return
res
return
res
...
@@ -626,7 +634,8 @@
...
@@ -626,7 +634,8 @@
"
analytic dimension {}
"
.
format
(
dimension_name
)
"
analytic dimension {}
"
.
format
(
dimension_name
)
)
)
if
code_vals
:
if
code_vals
:
force_code
.
write
(
code_vals
)
# These are behind-the-scenes links so bypass security rules.
force_code
.
sudo
().
write
(
code_vals
)
if
sync_parent
:
if
sync_parent
:
# This function is called as a method and can be overridden.
# This function is called as a method and can be overridden.
...
...
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