Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
7ad2eb35
Commit
7ad2eb35
authored
10 years ago
by
Richard Mathot
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] base: use current context when evaluation ir_actions' context
parent
1870fa81
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openerp/addons/base/ir/ir_actions.py
+20
-16
20 additions, 16 deletions
openerp/addons/base/ir/ir_actions.py
with
20 additions
and
16 deletions
openerp/addons/base/ir/ir_actions.py
+
20
−
16
View file @
7ad2eb35
...
...
@@ -320,22 +320,26 @@ class ir_actions_act_window(osv.osv):
ids
=
[
ids
]
results
=
super
(
ir_actions_act_window
,
self
).
read
(
cr
,
uid
,
ids
,
fields
=
fields
,
context
=
context
,
load
=
load
)
if
not
fields
or
'
help
'
in
fields
:
context
=
dict
(
context
or
{})
eval_dict
=
{
'
active_model
'
:
context
.
get
(
'
active_model
'
),
'
active_id
'
:
context
.
get
(
'
active_id
'
),
'
active_ids
'
:
context
.
get
(
'
active_ids
'
),
'
uid
'
:
uid
,
}
for
res
in
results
:
model
=
res
.
get
(
'
res_model
'
)
if
model
and
self
.
pool
.
get
(
model
):
try
:
with
tools
.
mute_logger
(
"
openerp.tools.safe_eval
"
):
eval_context
=
eval
(
res
[
'
context
'
]
or
"
{}
"
,
eval_dict
)
or
{}
except
Exception
:
continue
context
=
dict
(
context
or
{})
eval_dict
=
{
'
active_model
'
:
context
.
get
(
'
active_model
'
),
'
active_id
'
:
context
.
get
(
'
active_id
'
),
'
active_ids
'
:
context
.
get
(
'
active_ids
'
),
'
uid
'
:
uid
,
'
context
'
:
context
,
}
for
res
in
results
:
model
=
res
.
get
(
'
res_model
'
)
if
model
and
self
.
pool
.
get
(
model
):
try
:
with
tools
.
mute_logger
(
"
openerp.tools.safe_eval
"
):
eval_context
=
eval
(
res
[
'
context
'
]
or
"
{}
"
,
eval_dict
)
or
{}
res
[
'
context
'
]
=
str
(
eval_context
)
except
Exception
:
_logger
.
warning
(
"
ir_actions: Cannot evaluate context = %s with eval_dict = %s
"
%
(
res
[
'
context
'
]
or
"
{}
"
,
eval_dict
),
exc_info
=
True
)
continue
if
not
fields
or
'
help
'
in
fields
:
custom_context
=
dict
(
context
,
**
eval_context
)
res
[
'
help
'
]
=
self
.
pool
.
get
(
model
).
get_empty_list_help
(
cr
,
uid
,
res
.
get
(
'
help
'
,
""
),
context
=
custom_context
)
if
ids_int
:
...
...
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