mirror of https://github.com/OCA/social.git
[FIX] mail_tracking: allowed trackings compute
In the forward port of the permission check, a column was dropped from the tuple, but the following code wasn't adapted to the new tuple length. For clarity sake we also name the tuple unpacking into proper variables. TT43453pull/1367/head
parent
e0a4c5b1fe
commit
aea5fa7548
|
@ -7,7 +7,7 @@
|
||||||
{
|
{
|
||||||
"name": "Email tracking",
|
"name": "Email tracking",
|
||||||
"summary": "Email tracking system for all mails sent",
|
"summary": "Email tracking system for all mails sent",
|
||||||
"version": "15.0.2.0.4",
|
"version": "15.0.2.0.5",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"website": "https://github.com/OCA/social",
|
"website": "https://github.com/OCA/social",
|
||||||
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
|
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
|
||||||
|
|
|
@ -164,13 +164,13 @@ class MailTrackingEmail(models.Model):
|
||||||
[("id", "in", [x for x in partner_ids if x])]
|
[("id", "in", [x for x in partner_ids if x])]
|
||||||
)
|
)
|
||||||
return [
|
return [
|
||||||
x[0]
|
track_id
|
||||||
for x in msg_linked
|
for track_id, mail_msg_id, partner_id in msg_linked
|
||||||
if (x[1] in msg_ids) # We can read the linked message
|
if (mail_msg_id in msg_ids) # We can read the linked message
|
||||||
or (
|
or (
|
||||||
not any({x[1], x[2]}) and x[3] in partner_ids
|
not mail_msg_id and partner_id in partner_ids
|
||||||
) # No linked msg/mail but we can read the linked partner
|
) # No linked mail.message but we can read the linked partner
|
||||||
or (not any({x[1], x[2], x[3]})) # No linked record
|
or (not any({mail_msg_id, partner_id})) # No linked record
|
||||||
]
|
]
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|
Loading…
Reference in New Issue