From f1ed9373ae7b00fa4e2346629161aade69c1748e Mon Sep 17 00:00:00 2001 From: Emanuel Cino Date: Tue, 24 May 2022 14:22:46 +0200 Subject: [PATCH] FIX payment slip attachments for corresponding people --- .../models/partner_communication.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/partner_communication_switzerland/models/partner_communication.py b/partner_communication_switzerland/models/partner_communication.py index f958b7967..58e64e009 100644 --- a/partner_communication_switzerland/models/partner_communication.py +++ b/partner_communication_switzerland/models/partner_communication.py @@ -767,9 +767,9 @@ def get_sponsorship_payment_slip_attachments(self): # Include all active sponsorships for Permanent Order bv_sponsorships |= ( - sponsorships.filtered(lambda s: s.payment_mode_id == permanent_order) - .mapped("group_id.contract_ids") - .filtered(lambda s: s.state in ("active", "waiting")) + sponsorships.filtered(lambda s: s.partner_id == self.partner_id and s.payment_mode_id == permanent_order) + .mapped("group_id.contract_ids") + .filtered(lambda s: s.state in ("active", "waiting")) ) attachments = {}