summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-09-22 22:22:23 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-09-22 22:22:23 +0000
commite31d5c3930a18c4798702d1798302d508e3d0d6a (patch)
tree70adab032f130a1eb72270f1b2479f4105a41f58
parent56e5d790d3eb1b8668c7669266c2fa0c4d98fff6 (diff)
parenta68f3c46bb02d7205ed1209e2b30b786bf4c7a3c (diff)
Merged in form-sp (pull request #428)
Form sp
-rw-r--r--indoteknik_custom/models/account_move.py2
-rw-r--r--indoteknik_custom/models/letter_receivable.py12
-rw-r--r--indoteknik_custom/views/account_move.xml9
3 files changed, 23 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index c7feac9e..28e9156a 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -99,6 +99,8 @@ class AccountMove(models.Model):
reminder_sent_date = fields.Date(string="Tanggal Reminder Terkirim")
+ payment_difficulty = fields.Selection(string="Payment Difficulty", related='partner_id.payment_difficulty', readonly=True)
+
customer_promise_date = fields.Date(
string="Janji Bayar",
help="Tanggal janji bayar dari customer setelah reminder dikirim.",
diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py
index 1445800f..16034938 100644
--- a/indoteknik_custom/models/letter_receivable.py
+++ b/indoteknik_custom/models/letter_receivable.py
@@ -323,11 +323,23 @@ class SuratPiutang(models.Model):
'mimetype': 'application/pdf',
})
+ cc_list = [
+ 'finance@indoteknik.co.id',
+ 'akbar@indoteknik.co.id',
+ 'stephan@indoteknik.co.id',
+ 'darren@indoteknik.co.id'
+ ]
+
+ sales_email = self.sales_person_id.email if self.sales_person_id else None
+ if sales_email and sales_email not in cc_list:
+ cc_list.append(sales_email)
+
values = {
# 'subject': template.subject.replace('${object.name}', self.name or ''),
'subject': perihal_map.get(self.perihal, self.perihal or '') + " - " + (self.partner_id.name or ''),
'email_to': self.tujuan_email,
'email_from': 'finance@indoteknik.co.id',
+ 'email_cc': ",".join(sorted(set(cc_list))),
'body_html': body_html,
'attachments': [(attachment.name, attachment.datas)],
'reply_to': 'finance@indoteknik.co.id',
diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml
index c88effd5..ba86277a 100644
--- a/indoteknik_custom/views/account_move.xml
+++ b/indoteknik_custom/views/account_move.xml
@@ -59,6 +59,10 @@
<attribute name="widget">pdf_viewer</attribute>
</field>
<field name="invoice_user_id" position="after">
+ <field name="payment_difficulty" widget="badge"
+ decoration-info="payment_difficulty == 'normal'"
+ decoration-warning="payment_difficulty in ('agak_sulit', 'sulit')"
+ decoration-danger="payment_difficulty == 'bermasalah'"/>
<field name="invoice_origin"/>
<field name="date_kirim_tukar_faktur"/>
<field name="shipper_faktur_id"/>
@@ -122,6 +126,11 @@
decoration-danger="mark_upload_efaktur == 'belum_upload'"
decoration-success="mark_upload_efaktur == 'sudah_upload'" />
<field name="due_extension" optional="hide"/>
+ <field name="payment_difficulty" widget="badge"
+ decoration-info="payment_difficulty == 'normal'"
+ decoration-warning="payment_difficulty in ('agak_sulit', 'sulit')"
+ decoration-danger="payment_difficulty == 'bermasalah'"
+ optional="hide"/>
</field>
<field name="payment_state" position="after">
<field name="invoice_payment_term_id" optional="hide"/>