diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-08-22 08:20:42 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-08-22 08:20:42 +0700 |
| commit | dab315df817429db7a8445f4dd08c9722e4d328a (patch) | |
| tree | b631443a471c7cefaa9ed877d6f492b4d8da74d4 | |
| parent | 70a2b42b40932936bb0cf194005c9523ebd8a9df (diff) | |
(andri) sync promise date hanya untuk User Finance
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 8493bb24..599b3220 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -129,6 +129,9 @@ class AccountMove(models.Model): def action_sync_promise_date(self): self.ensure_one() + finance_user_ids = [688] + if self.env.user.id not in finance_user_ids: + raise UserError('Hanya Finance (Widya) yang dapat menggunakan fitur ini.') if not self.customer_promise_date: raise UserError("Isi Janji Bayar terlebih dahulu sebelum melakukan sinkronisasi.") @@ -177,7 +180,7 @@ class AccountMove(models.Model): ('payment_state', 'not in', ['paid', 'in_payment', 'reversed']), ('invoice_date_due', 'in', target_dates), ('date_terima_tukar_faktur', '!=', False) - ]) + ], limit=5) _logger.info(f"Invoices: {invoices}") invoices = invoices.filtered( @@ -328,7 +331,7 @@ class AccountMove(models.Model): 'reply_to': 'finance@indoteknik.co.id', } - template.send_mail(invs[0].id, force_send=True, email_values=values) + # 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 |
