summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-07-19 15:11:31 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-07-19 15:11:31 +0700
commit698e075cf3874d4eaf5ac3f44f4a5b1b1832b93c (patch)
tree172a054173be40f39a85dfeadcdd78952eebdb41
parent09c24278d60eb5bc5a92ad9b3f5389d329641228 (diff)
(andri) add widget for remaining & due date, add validasi confirm payment
-rw-r--r--indoteknik_custom/models/down_payment.py8
-rw-r--r--indoteknik_custom/views/down_payment.xml18
2 files changed, 18 insertions, 8 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py
index 920b1b5b..df6c0eba 100644
--- a/indoteknik_custom/models/down_payment.py
+++ b/indoteknik_custom/models/down_payment.py
@@ -143,8 +143,12 @@ class DownPayment(models.Model):
def action_confirm_payment(self):
- # Logic untuk konfirmasi pembayaran
- return
+ for rec in self:
+ if not rec.attachment_file_image and not rec.attachment_file_pdf:
+ raise UserError('Tidak bisa konfirmasi pembayaran karena belum ada bukti attachment (PDF/Image).')
+
+ rec.status_pay_down_payment = 'payment'
+
def action_approval_check(self):
for record in self:
diff --git a/indoteknik_custom/views/down_payment.xml b/indoteknik_custom/views/down_payment.xml
index 322b18f6..3c5f4f1f 100644
--- a/indoteknik_custom/views/down_payment.xml
+++ b/indoteknik_custom/views/down_payment.xml
@@ -46,10 +46,14 @@
<hr/>
<field name="user_id" readonly="1"/>
<field name="departement_type"/>
- <field name="status_pay_down_payment" readonly="1"/>
+ <field name="status_pay_down_payment"
+ readonly="1"
+ decoration-success="status_pay_down_payment == 'payment'"
+ decoration-danger="status_pay_down_payment == 'pending'"
+ widget="badge"/>
<field name="create_date" readonly="1"/>
- <field name="estimated_return_date" readonly="1"/>
- <field name="days_remaining" readonly="1"/>
+ <field name="estimated_return_date" readonly="1" widget="badge"/>
+ <field name="days_remaining" readonly="1" widget="badge"/>
<field name="detail_note" attrs="{'readonly': [('status', '=', 'approved')]}"/>
</group>
@@ -62,7 +66,9 @@
<field name="attachment_file_image" filename="attachment_filename"
widget="image"
- attrs="{'invisible': [('attachment_type', '!=', 'image')]}"/>
+ attrs="{'invisible': [('attachment_type', '!=', 'image')]}"
+ style="max-width:250px; max-height:250px; object-fit:contain;"/>
+ <br/>
</group>
</group>
@@ -84,7 +90,7 @@
<field name="applicant_name"/>
<field name="nominal"/>
<field name="departement_type" optional='hide'/>
- <field name="days_remaining" readonly="1"/>
+ <field name="days_remaining" readonly="1" widget="badge"/>
<field name="status"
readonly="1"
decoration-success="status == 'approved'"
@@ -94,7 +100,7 @@
decoration-success="status_pay_down_payment == 'payment'"
decoration-danger="status_pay_down_payment == 'pending'"
widget="badge"/>
- <field name="estimated_return_date" optional="hide"/>
+ <field name="estimated_return_date" optional="hide" widget="badge" />
</tree>
</field>
</record>