summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-07-14 17:03:30 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-07-14 17:03:30 +0700
commit2eb64e50e1d41af96cf29097a5781d4df08d5f16 (patch)
tree4f7e45008821a62959585533ca20527627fdd8dc /indoteknik_custom/models/account_move.py
parentee77ca5ec2947ba672c7becee3ecb583f4f25916 (diff)
parent1b70be54f939974c0232abf215f8a432b6c15244 (diff)
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 5ac1c6e5..72ac5452 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -85,7 +85,7 @@ class AccountMove(models.Model):
today + timedelta(days=7),
]
- partner = self.env['res.partner'].search([('name', 'ilike', 'FLYNINDO MEGA PERSADA')], limit=1)
+ partner = self.env['res.partner'].search([('name', 'ilike', 'BANGUNAN TEKNIK GRUP')], limit=1)
if not partner:
_logger.info("Partner tidak ditemukan.")
return
@@ -149,11 +149,27 @@ class AccountMove(models.Model):
'email_to': 'andrifebriyadiputra@gmail.com', # Ubah ke partner.email untuk produksi
'email_from': 'finance@indoteknik.co.id',
'body_html': body_html,
+ 'reply_to': f'invoice+account.move_{invs[0].id}@indoteknik.co.id',
}
_logger.info(f"VALUES: {values}")
template.send_mail(invs[0].id, force_send=True, email_values=values)
+
+ # Default System User
+ user_system = self.env['res.users'].browse(25)
+ system_id = user_system.partner_id.id if user_system else False
+ _logger.info(f"System User: {user_system.name} ({user_system.id})")
+ _logger.info(f"System User ID: {system_id}")
+
+ for inv in invs:
+ inv.message_post(
+ subject=subject,
+ body=body_html,
+ subtype_id=self.env.ref('mail.mt_note').id,
+ author_id=system_id,
+ )
+
_logger.info(f"Reminder terkirim ke {partner.name} ({values['email_to']}) → {len(invs)} invoice")