summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-15 14:45:43 +0700
committerAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-15 14:45:43 +0700
commit570087805ec46b8af7651187cfcf0ecef2733912 (patch)
treedcdbe013de77cd696d9935d738f430641a911768
parent2b61b810f5b12f32bf837ab34c12d832d0be12eb (diff)
(andri) rev penamaan surat dan doc
-rw-r--r--indoteknik_custom/models/letter_receivable.py5
-rw-r--r--indoteknik_custom/report/report_surat_piutang.xml1
-rw-r--r--indoteknik_custom/views/letter_receivable.xml4
-rw-r--r--indoteknik_custom/views/letter_receivable_mail_template.xml2
4 files changed, 7 insertions, 5 deletions
diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py
index fe598e50..18485f01 100644
--- a/indoteknik_custom/models/letter_receivable.py
+++ b/indoteknik_custom/models/letter_receivable.py
@@ -215,7 +215,7 @@ class SuratPiutang(models.Model):
attachment_base64 = base64.b64encode(pdf_content)
attachment = self.env['ir.attachment'].create({
- 'name': f"Surat Piutang {self.name}.pdf",
+ 'name': f"{self.perihal_label} - {self.partner_id.name}.pdf",
'type': 'binary',
'datas': attachment_base64,
'res_model': 'surat.piutang',
@@ -224,7 +224,8 @@ class SuratPiutang(models.Model):
})
values = {
- 'subject': template.subject.replace('${object.name}', self.name or ''),
+ # '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',
'body_html': body_html,
diff --git a/indoteknik_custom/report/report_surat_piutang.xml b/indoteknik_custom/report/report_surat_piutang.xml
index 4685f5a6..770aa535 100644
--- a/indoteknik_custom/report/report_surat_piutang.xml
+++ b/indoteknik_custom/report/report_surat_piutang.xml
@@ -9,6 +9,7 @@
<field name="report_type">qweb-pdf</field>
<field name="report_name">indoteknik_custom.report_surat_piutang</field>
<field name="report_file">indoteknik_custom.report_surat_piutang</field>
+ <field name="print_report_name">'%s - %s' % (object.perihal_label or '', object.partner_id.name or '')</field>
<field name="binding_model_id" ref="model_surat_piutang"/>
<field name="binding_type">report</field>
</record>
diff --git a/indoteknik_custom/views/letter_receivable.xml b/indoteknik_custom/views/letter_receivable.xml
index 334e83c4..ad1f6281 100644
--- a/indoteknik_custom/views/letter_receivable.xml
+++ b/indoteknik_custom/views/letter_receivable.xml
@@ -26,8 +26,8 @@
<form string="Surat Piutang">
<header>
<field name="state" widget="statusbar" statusbar_visible="draft,waiting_approval,sent"/>
- <button name="action_approve" type="object" string="Approval &amp; Send" class="btn-primary"/>
- <button name="action_send_letter" type="object" string="Email Send" class="btn-primary"/>
+ <button name="action_approve" type="object" string="Approve &amp; Send" class="btn-primary"/>
+ <!-- <button name="action_send_letter" type="object" string="Email Send" class="btn-primary"/> -->
</header>
<div class="alert alert-info"
role="alert"
diff --git a/indoteknik_custom/views/letter_receivable_mail_template.xml b/indoteknik_custom/views/letter_receivable_mail_template.xml
index 0ee6f75c..fa0fbc86 100644
--- a/indoteknik_custom/views/letter_receivable_mail_template.xml
+++ b/indoteknik_custom/views/letter_receivable_mail_template.xml
@@ -4,7 +4,7 @@
<record id="letter_receivable_mail_template" model="mail.template">
<field name="name">Surat Piutang Invoices</field>
<field name="model_id" ref="indoteknik_custom.model_surat_piutang"/>
- <field name="subject">Surat Peringatan Piutang ${object.name}</field>
+ <field name="subject"></field>
<field name="email_from">finance@indoteknik.co.id</field>
<field name="email_to"></field>
<field name="body_html" type="html">