summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-09-22 10:44:51 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-09-22 10:44:51 +0700
commit7f97c16e662903d42b405c618c2e26a0b7ba5146 (patch)
tree35fec843785f5d2bac6a937b41579d12a1218255
parent5319325fb717b0fa452ba305cfdb661c3b9de15a (diff)
(andri) cc email
-rw-r--r--indoteknik_custom/models/letter_receivable.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py
index 1445800f..16034938 100644
--- a/indoteknik_custom/models/letter_receivable.py
+++ b/indoteknik_custom/models/letter_receivable.py
@@ -323,11 +323,23 @@ class SuratPiutang(models.Model):
'mimetype': 'application/pdf',
})
+ cc_list = [
+ 'finance@indoteknik.co.id',
+ 'akbar@indoteknik.co.id',
+ 'stephan@indoteknik.co.id',
+ 'darren@indoteknik.co.id'
+ ]
+
+ sales_email = self.sales_person_id.email if self.sales_person_id else None
+ if sales_email and sales_email not in cc_list:
+ cc_list.append(sales_email)
+
values = {
# 'subject': template.subject.replace('${object.name}', self.name or ''),
'subject': perihal_map.get(self.perihal, self.perihal or '') + " - " + (self.partner_id.name or ''),
'email_to': self.tujuan_email,
'email_from': 'finance@indoteknik.co.id',
+ 'email_cc': ",".join(sorted(set(cc_list))),
'body_html': body_html,
'attachments': [(attachment.name, attachment.datas)],
'reply_to': 'finance@indoteknik.co.id',