summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-02-16 10:09:01 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-02-16 10:09:01 +0700
commit7a9d6dab1578f7f2d2ea77b58c8fa4eeec4a037f (patch)
treeedb067ecc275873d9f1aaf0f9d04c5718fe76c8f /indoteknik_custom/models/account_move.py
parentd2a64b4e6023f0768d5c326c833fd5a9d8a11444 (diff)
parentc6c01d5b7bfa1a95e0e8191a71215f76960f6b88 (diff)
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into cr_renca_find
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index e1360cfa..42467b78 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -587,6 +587,10 @@ class AccountMove(models.Model):
records = self.search([('id', 'in', self.ids)])
template = self.env.ref('indoteknik_custom.mail_template_efaktur_document')
+ ICP = self.env['ir.config_parameter'].sudo()
+ special_partner_ids = set(
+ int(x) for x in (ICP.get_param('efaktur.special_partner_ids') or '').split(',') if x
+ )
for record in records:
if record.invoice_payment_term_id.id == 26:
@@ -595,6 +599,18 @@ class AccountMove(models.Model):
'attachment_ids': [(4, attachment.id)]
}
template.send_mail(record.id, email_values=email_values, force_send=True)
+
+ elif record.partner_id.id in special_partner_ids:
+ attachment = self.generate_attachment(record)
+ email_list = [record.partner_id.email] if record.partner_id.email else []
+ if record.real_invoice_id and record.real_invoice_id.email:
+ email_list.append(record.real_invoice_id.email)
+
+ email_values = {
+ 'email_to': ",".join(set(email_list)),
+ 'attachment_ids': [(4, attachment.id)]
+ }
+ template.send_mail(record.id, email_values=email_values, force_send=True)
# @api.model
# def create(self, vals):