diff options
| author | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-03-02 09:59:00 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-03-02 09:59:00 +0700 |
| commit | 837df993141041c9d1d19b8ea8de82c6fae9dc99 (patch) | |
| tree | 7c2218efa76f3e4abb10708ab3d1ffdd055b976a | |
| parent | 7cd31c8dab49c59f8c6e67528d528514cc13932c (diff) | |
(andri) add customer reference pada mail faktur pajak khusus customer tertentu
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 3 | ||||
| -rw-r--r-- | 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 @@ <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> |
