summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/account_move.py3
-rw-r--r--indoteknik_custom/views/mail_template_efaktur.xml2
2 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 42467b78..a317dccc 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -601,6 +601,7 @@ class AccountMove(models.Model):
template.send_mail(record.id, email_values=email_values, force_send=True)
elif record.partner_id.id in special_partner_ids:
+ cust_ref = record.sale_id.client_order_ref if record.sale_id and record.sale_id.client_order_ref else ''
attachment = self.generate_attachment(record)
email_list = [record.partner_id.email] if record.partner_id.email else []
if record.real_invoice_id and record.real_invoice_id.email:
@@ -610,7 +611,7 @@ class AccountMove(models.Model):
'email_to': ",".join(set(email_list)),
'attachment_ids': [(4, attachment.id)]
}
- template.send_mail(record.id, email_values=email_values, force_send=True)
+ template.with_context(cust_ref=cust_ref).send_mail(record.id, email_values=email_values, force_send=True)
# @api.model
# def create(self, vals):
diff --git a/indoteknik_custom/views/mail_template_efaktur.xml b/indoteknik_custom/views/mail_template_efaktur.xml
index b0637691..c539ccd1 100644
--- a/indoteknik_custom/views/mail_template_efaktur.xml
+++ b/indoteknik_custom/views/mail_template_efaktur.xml
@@ -11,7 +11,7 @@
<field name="email_to">${object.partner_id.email|safe}</field>
<field name="body_html" type="html">
<p>Dengan Hormat Bpk/Ibu ${object.partner_id.name},</p>
- <p>Terlampir Faktur Pajak atas Invoice ${object.name}.</p>
+ <p>Terlampir Faktur Pajak atas Invoice ${object.name} ${ctx.get('cust_ref') and ' (' + ctx.get('cust_ref') + ')' or '.'} </p>
<p><strong>Keterangan:</strong></p>
<p>Mohon dicek langsung faktur pajak terlampir, terutama informasi nomor NPWP dan alamat NPWP serta nama pembelian barang. Jika ada yang tidak sesuai, mohon segera menginformasikan kepada kami paling lambat 1 (satu) minggu dari tanggal email ini. Revisi faktur pajak tidak dapat kami proses apabila sudah melewati 1 (satu) minggu. Harap maklum.</p>
<p>Mohon balas email ini jika sudah menerima, terima kasih.</p>