Skip to content

Commit ad9f12d

Browse files
[FIX] Avoid counting an attachment multiple times
1 parent 95ed452 commit ad9f12d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

purchase_edi_file/models/purchase_order.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ def generate_and_send_edi_files(self):
2424
continue
2525
partner = purchase.partner_id
2626
profiles_lines = purchase.order_line._get_lines_by_profiles(partner)
27-
attachments = self.env["ir.attachment"]
2827
attachment_profiles = {}
2928
for profile, records in profiles_lines.items():
3029
if not records:
3130
continue
32-
attachments |= profile.get_attachment(
31+
attachment_profiles[profile] = profile.get_attachment(
3332
records, res_id=purchase.id, res_model=self._name
3433
)
35-
attachment_profiles[profile] = attachments
3634
if not attachment_profiles:
3735
continue
3836
attachment_by_transfer = {}

0 commit comments

Comments
 (0)