From 4ea4152ddd4d4f6b66aff8eff71201f0a48533fe Mon Sep 17 00:00:00 2001 From: David Date: Mon, 22 May 2023 10:42:35 +0200 Subject: [PATCH] [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. TT43453 --- mail_tracking/models/mail_tracking_email.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mail_tracking/models/mail_tracking_email.py b/mail_tracking/models/mail_tracking_email.py index c97a34911..64ec73e21 100644 --- a/mail_tracking/models/mail_tracking_email.py +++ b/mail_tracking/models/mail_tracking_email.py @@ -164,13 +164,13 @@ class MailTrackingEmail(models.Model): [("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 + track_id + for track_id, mail_msg_id, partner_id in msg_linked + if (mail_msg_id in msg_ids) # We can read the linked message or ( - not any({x[1], x[2]}) and x[3] in partner_ids - ) # No linked msg/mail but we can read the linked partner - or (not any({x[1], x[2], x[3]})) # No linked record + not mail_msg_id and partner_id in partner_ids + ) # No linked mail.message but we can read the linked partner + or (not any({mail_msg_id, partner_id})) # No linked record ] @api.model