From 07ae0b7f2eab52daf5e33dc47450189537be2e1c Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 7 Oct 2025 18:20:53 +0700 Subject: (andri) email cc surat piutang --- indoteknik_custom/models/letter_receivable.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indoteknik_custom/models/letter_receivable.py') diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index ffe14491..821825d6 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -193,11 +193,11 @@ class SuratPiutang(models.Model): line.amount_residual or 0.0 for line in rec.line_ids if line.selected ) - @api.constrains("tujuan_email") - def _check_email_format(self): - for rec in self: - if rec.tujuan_email and not mail.single_email_re.match(rec.tujuan_email): - raise ValidationError(_("Format email tidak valid: %s") % rec.tujuan_email) + # @api.constrains("tujuan_email") + # def _check_email_format(self): + # for rec in self: + # if rec.tujuan_email and not mail.single_email_re.match(rec.tujuan_email): + # raise ValidationError(_("Format email tidak valid: %s") % rec.tujuan_email) def action_approve(self): wib = pytz.timezone('Asia/Jakarta') @@ -363,6 +363,7 @@ class SuratPiutang(models.Model): 'email_to': self.tujuan_email, 'email_from': 'finance@indoteknik.co.id', # 'email_cc': ",".join(sorted(set(cc_list))), + 'email_cc': 'finance@indoteknik.co.id', 'body_html': body_html, # Menggunakan body_html yang sudah ditentukan di atas 'attachments': [(attachment.name, attachment.datas)], # 'reply_to': 'finance@indoteknik.co.id', -- cgit v1.2.3 From ec5053921c0e858a4c33fb2cddf1152600831f7a Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 7 Oct 2025 18:25:04 +0700 Subject: (andri) fix --- indoteknik_custom/models/letter_receivable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models/letter_receivable.py') diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index 821825d6..f75af92e 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -362,11 +362,11 @@ class SuratPiutang(models.Model): 'subject': subject, # Menggunakan subject yang sudah ditentukan di atas 'email_to': self.tujuan_email, 'email_from': 'finance@indoteknik.co.id', - # 'email_cc': ",".join(sorted(set(cc_list))), + 'email_cc': ",".join(sorted(set(cc_list))), 'email_cc': 'finance@indoteknik.co.id', 'body_html': body_html, # Menggunakan body_html yang sudah ditentukan di atas 'attachments': [(attachment.name, attachment.datas)], - # 'reply_to': 'finance@indoteknik.co.id', + 'reply_to': 'finance@indoteknik.co.id', } template.with_context(mail_post_autofollow=False).send_mail( -- cgit v1.2.3 From 776bc2d9f132050ceed95ef2a96eb1dcf8ad1c44 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 7 Oct 2025 18:44:12 +0700 Subject: (andri) add button select & unselect all --- indoteknik_custom/models/letter_receivable.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indoteknik_custom/models/letter_receivable.py') diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index f75af92e..370e0909 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -69,6 +69,18 @@ class SuratPiutang(models.Model): "sp1": "sp2", "sp2": "sp3", } + + def action_select_all_lines(self): + for rec in self: + if not rec.line_ids: + raise UserError(_("Tidak ada invoice line untuk dipilih.")) + rec.line_ids.write({'selected': True}) + + def action_unselect_all_lines(self): + for rec in self: + if not rec.line_ids: + raise UserError(_("Tidak ada invoice line untuk dihapus seleksinya.")) + rec.line_ids.write({'selected': False}) @api.onchange('partner_id') def _onchange_partner_id_domain(self): -- cgit v1.2.3 From 861879ce8479b22bd340eaa3835c8682810866dd Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Tue, 7 Oct 2025 18:53:24 +0700 Subject: (andri) fix --- indoteknik_custom/models/letter_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom/models/letter_receivable.py') diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index 370e0909..f9f65b65 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -375,7 +375,7 @@ class SuratPiutang(models.Model): 'email_to': self.tujuan_email, 'email_from': 'finance@indoteknik.co.id', 'email_cc': ",".join(sorted(set(cc_list))), - 'email_cc': 'finance@indoteknik.co.id', + # 'email_cc': 'finance@indoteknik.co.id', # testing 'body_html': body_html, # Menggunakan body_html yang sudah ditentukan di atas 'attachments': [(attachment.name, attachment.datas)], 'reply_to': 'finance@indoteknik.co.id', -- cgit v1.2.3 From 51155d702da715c82ea55322ee049d9b1ee34faa Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Wed, 8 Oct 2025 11:43:57 +0700 Subject: (andri) fix approval --- indoteknik_custom/models/letter_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom/models/letter_receivable.py') diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index f9f65b65..a98e46a1 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -215,7 +215,7 @@ class SuratPiutang(models.Model): wib = pytz.timezone('Asia/Jakarta') now_wib = datetime.now(wib) - sales_manager_ids = [10] # ganti dengan ID user Sales Manager + sales_manager_ids = [19] # ganti dengan ID user Sales Manager pimpinan_user_ids = [7] # ganti dengan ID user Pimpinan for rec in self: -- cgit v1.2.3