From 837df993141041c9d1d19b8ea8de82c6fae9dc99 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Mon, 2 Mar 2026 09:59:00 +0700 Subject: (andri) add customer reference pada mail faktur pajak khusus customer tertentu --- indoteknik_custom/models/account_move.py | 3 ++- indoteknik_custom/views/mail_template_efaktur.xml | 2 +- 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 @@ ${object.partner_id.email|safe}

Dengan Hormat Bpk/Ibu ${object.partner_id.name},

-

Terlampir Faktur Pajak atas Invoice ${object.name}.

+

Terlampir Faktur Pajak atas Invoice ${object.name} ${ctx.get('cust_ref') and ' (' + ctx.get('cust_ref') + ')' or '.'}

Keterangan:

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.

Mohon balas email ini jika sudah menerima, terima kasih.

-- cgit v1.2.3