From 9b0ce82de8518012198f526737403648f94d21c7 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 27 Aug 2025 16:05:55 +0700 Subject: (andri) test --- indoteknik_custom/models/account_move.py | 70 +++++++--------------- .../views/mail_template_invoice_reminder.xml | 1 + 2 files changed, 24 insertions(+), 47 deletions(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index d9d15764..b97edd0a 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -179,7 +179,8 @@ class AccountMove(models.Model): ('state', '=', 'posted'), ('payment_state', 'not in', ['paid', 'in_payment', 'reversed']), ('invoice_date_due', 'in', target_dates), - ('date_terima_tukar_faktur', '!=', False) + ('date_terima_tukar_faktur', '!=', False), + ('partner_id', 'in' , [14709]) ], limit=5) _logger.info(f"Invoices: {invoices}") @@ -295,48 +296,22 @@ class AccountMove(models.Model): currency = invs[0].currency_id if invs else partner.company_id.currency_id limit_info_html = f""" - - - - - - - - - - - - - - - -
- Pembayaran Tempo -
-

Kredit Limit Anda
- {formatLang(self.env, blocking_limit, currency_obj=currency)} -

-

Status Detail Tempo Pembayaran Anda
- {partner.property_payment_term_id.name or 'Review'} -

-
-
- {formatLang(self.env, blocking_limit - outstanding_amount, currency_obj=currency)} -
-
Sisa Kredit Limit
-
-
- {formatLang(self.env, outstanding_amount, currency_obj=currency)} -
-
Kredit Limit Terpakai
-
{len(outstanding_invoices)} Transaksi
-
-
- {formatLang(self.env, overdue_amount, currency_obj=currency)} -
-
Jatuh Tempo
-
{len(overdue_invoices)} Invoice
-
+

Informasi Tambahan:

+ """ days_to_due_message = "" @@ -385,7 +360,8 @@ class AccountMove(models.Model): ).replace('${object.name}', partner.name) \ .replace('${object.partner_id.name}', partner.name) \ .replace('${days_to_due_message}', days_to_due_message) \ - .replace('${closing_message}', limit_info_html + closing_message) + .replace('${closing_message}', closing_message) \ + .replace('${limit_info_html}', limit_info_html) cc_list = [ 'finance@indoteknik.co.id', @@ -408,11 +384,11 @@ class AccountMove(models.Model): # 'reply_to': 'finance@indoteknik.co.id', } - # template.send_mail(invs[0].id, force_send=True, email_values=values) - _logger.info(f"Mengirim email ke: {values['email_to']} > email CC: {values['email_cc']}") + template.send_mail(invs[0].id, force_send=True, email_values=values) + # _logger.info(f"Mengirim email ke: {values['email_to']} > email CC: {values['email_cc']}") _logger.info(f"Reminder terkirim ke {partner.name} ({values['email_to']}) → {len(invs)} invoice (dtd = {dtd})") # flag - invs.write({'reminder_sent_date': today}) + # invs.write({'reminder_sent_date': today}) # Post ke chatter user_system = self.env['res.users'].browse(25) system_id = user_system.partner_id.id if user_system else False diff --git a/indoteknik_custom/views/mail_template_invoice_reminder.xml b/indoteknik_custom/views/mail_template_invoice_reminder.xml index 3a02fa2e..13c02a08 100644 --- a/indoteknik_custom/views/mail_template_invoice_reminder.xml +++ b/indoteknik_custom/views/mail_template_invoice_reminder.xml @@ -33,6 +33,7 @@

${closing_message}

+ ${limit_info_html}

Terima Kasih.



-- cgit v1.2.3