summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-07-09 14:04:27 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-07-09 14:04:27 +0700
commit028480352e86ac8cbfef5ea4834caf111ebfb3d4 (patch)
tree22efc45dd6f40f0b5216b005f9d1904256f4a189
parentc72db0d0fa214e6691fa9a293020e7091a9c82c2 (diff)
(andri) try
-rw-r--r--indoteknik_custom/models/account_move.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index e63f4cb2..436dfcaa 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -114,12 +114,15 @@ class AccountMove(models.Model):
template = self.env.ref('indoteknik_custom.mail_template_invoice_due_reminder')
try:
- template.with_context(invoices=invoices).send_mail(partner.id, force_send=True, email_values={
- 'email_to': 'andrifebriyadiputra@gmail.com', # test override
- })
- _logger.info(f"Reminder terkirim ke {partner.name} → {len(invoices)} invoice")
+ email_values = template.with_context(invoices=invoices).generate_email(partner.id)
+ email_values['email_to'] = 'andrifebriyadiputra@gmail.com' # override untuk test
+ email_values['email_from'] = 'finance@indoteknik.co.id'
+
+ self.env['mail.mail'].create(email_values).send()
+ _logger.info(f"[Reminder Terkirim] ke {partner.name} → {len(invoices)} invoice")
except Exception as e:
- _logger.error(f"Gagal kirim email ke {partner.name}: {str(e)}")
+ _logger.error(f"[Reminder Gagal] ke {partner.name} → {str(e)}")
+
# for inv in invoices:
# try: