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
c5b119e2
Commit
c5b119e2
authored
14 years ago
by
Fabien Pinckaers
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] logs
bzr revid: fp@tinyerp.com-20101016140328-4ke8easdcpxbnicz
parent
8f4d9d42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/addons/base/res/res_log.py
+13
-16
13 additions, 16 deletions
bin/addons/base/res/res_log.py
bin/addons/base/res/res_log_view.xml
+9
-9
9 additions, 9 deletions
bin/addons/base/res/res_log_view.xml
with
22 additions
and
25 deletions
bin/addons/base/res/res_log.py
+
13
−
16
View file @
c5b119e2
...
...
@@ -52,22 +52,19 @@ class res_log(osv.osv):
# TODO: do not return secondary log if same object than in the model (but unlink it)
def
get
(
self
,
cr
,
uid
,
context
=
None
):
unread_log_ids
=
self
.
search
(
cr
,
uid
,
[(
'
user_id
'
,
'
=
'
,
uid
),
(
'
read
'
,
'
=
'
,
False
)],
context
=
context
)
unread_logs
=
self
.
read
(
cr
,
uid
,
unread_log_ids
,
[
'
name
'
,
'
res_model
'
,
'
res_id
'
],
context
=
context
)
unread_log_ids
=
self
.
search
(
cr
,
uid
,
[(
'
user_id
'
,
'
=
'
,
uid
),
(
'
read
'
,
'
=
'
,
False
)],
context
=
context
)
res
=
self
.
read
(
cr
,
uid
,
unread_log_ids
,
[
'
name
'
,
'
res_model
'
,
'
res_id
'
],
context
=
context
)
res
.
reverse
()
result
=
[]
res_dict
=
{}
for
r
in
res
:
if
r
[
'
res_model
'
]
not
in
res_dict
:
res_dict
[
r
[
'
res_model
'
]]
=
True
result
.
insert
(
0
,
r
)
self
.
write
(
cr
,
uid
,
unread_log_ids
,
{
'
read
'
:
True
},
context
=
context
)
return
unread_logs
return
result
def
search
(
self
,
cr
,
uid
,
args
,
offset
=
0
,
limit
=
None
,
order
=
None
,
context
=
None
,
count
=
False
):
log_ids
=
super
(
res_log
,
self
).
search
(
cr
,
uid
,
args
,
offset
,
limit
,
order
,
context
,
count
)
logs
=
{}
for
log
in
self
.
browse
(
cr
,
uid
,
log_ids
,
context
=
context
):
res_dict
=
logs
.
get
(
log
.
res_model
,
{})
res_dict
.
update
({
log
.
res_id
:
log
.
id
})
logs
.
update
({
log
.
res_model
:
res_dict
})
res
=
map
(
lambda
x
:
x
.
values
(),
logs
.
values
())
return
tools
.
flatten
(
res
)
res_log
()
This diff is collapsed.
Click to expand it.
bin/addons/base/res/res_log_view.xml
+
9
−
9
View file @
c5b119e2
...
...
@@ -7,13 +7,15 @@
<field
name=
"type"
>
search
</field>
<field
name=
"arch"
type=
"xml"
>
<search
string=
"Logs"
>
<filter
icon=
"terp-stock_align_left_24"
string=
"Read"
domain=
"[('read','=',True)]"
name=
"read"
/>
<filter
icon=
"terp-stock_align_left_24"
string=
"Unread"
domain=
"[('read','<>',True)]"
name=
"unread"
/>
<separator
orientation=
"vertical"
/>
<filter
icon=
"terp-stock_align_left_24"
string=
"My Logs"
domain=
"[('user_id','=',uid)]"
name=
"my"
/>
<separator
orientation=
"vertical"
/>
<field
name=
"name"
/>
<field
name=
"user_id"
/>
<field
name=
"res_model"
/>
<field
name=
"create_date"
/>
<field
name=
"read"
/>
</search>
</field>
</record>
...
...
@@ -37,15 +39,13 @@
<field
name=
"arch"
type=
"xml"
>
<form
string=
"Logs"
>
<group
colspan=
"4"
col=
"6"
>
<field
name=
"name"
/>
<field
name=
"create_date"
/>
<field
name=
"read"
readonly=
"1"
/>
<field
name=
"name"
/>
<field
name=
"create_date"
/>
<field
name=
"read"
/>
<field
name=
"user_id"
/>
<field
name=
"res_model"
/>
<field
name=
"res_id"
/>
</group>
<group
colspan=
"4"
col=
"6"
>
<field
name=
"user_id"
/>
<field
name=
"res_model"
/>
<field
name=
"res_id"
/>
</group>
</form>
</field>
</record>
...
...
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