Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_liste_ministere
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_liste_ministere
Commits
c0db5205
Commit
c0db5205
authored
2 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[fix] temporary fix OCA error module before merging PR
parent
254d9166
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/__init__.py
+1
-0
1 addition, 0 deletions
models/__init__.py
models/mail_tracking_email.py
+43
-0
43 additions, 0 deletions
models/mail_tracking_email.py
with
44 additions
and
0 deletions
models/__init__.py
+
1
−
0
View file @
c0db5205
...
...
@@ -11,3 +11,4 @@ from . import res_partner_ministere
from
.
import
scop_liasse_fiscale
from
.
import
scop_models_lm
from
.
import
scop_partner_staff
from
.
import
mail_tracking_email
This diff is collapsed.
Click to expand it.
models/mail_tracking_email.py
0 → 100644
+
43
−
0
View file @
c0db5205
from
odoo
import
models
class
MailTrackingEmail
(
models
.
Model
):
_inherit
=
"
mail.tracking.email
"
def
_find_allowed_tracking_ids
(
self
):
"""
Override parent
TODO: delete afer merge PR https://github.com/OCA/social/pull/1128
"""
# Admins passby this filter
if
not
self
or
self
.
env
.
user
.
has_group
(
"
base.group_system
"
):
return
self
.
ids
# Override ORM to get the values directly
self
.
_cr
.
execute
(
"""
SELECT id, mail_message_id, partner_id
FROM mail_tracking_email WHERE id IN %s
"""
,
(
tuple
(
self
.
ids
),),
)
msg_linked
=
self
.
_cr
.
fetchall
()
if
not
msg_linked
:
return
[]
_
,
msg_ids
,
partner_ids
=
zip
(
*
msg_linked
)
# Filter messages with their ACL rules avoiding False values fetched in the set
msg_ids
=
self
.
env
[
"
mail.message
"
].
_search
(
[(
"
id
"
,
"
in
"
,
[
x
for
x
in
msg_ids
if
x
])]
)
partner_ids
=
self
.
env
[
"
res.partner
"
].
_search
(
[(
"
id
"
,
"
in
"
,
[
x
for
x
in
partner_ids
if
x
])]
)
return
[
x
[
0
]
for
x
in
msg_linked
if
(
x
[
1
]
in
msg_ids
)
# We can read the linked message
or
(
not
any
({
x
[
1
],
x
[
2
]})
and
x
[
2
]
in
partner_ids
)
# No linked msg/mail but we can read the linked partner
or
(
not
any
({
x
[
1
],
x
[
2
],
x
[
2
]}))
# No linked 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