summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-07-28 12:56:06 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-07-28 12:56:06 +0700
commit9606b73b33a01291ecbcb9154e32212ba5692bdb (patch)
tree8b3152bd099e55f5dcea0988911b351550af342f
parent9eb74d5978a1d18c3374dbc0b4358bd189cfc8e9 (diff)
(andri) fix status done not realized
-rw-r--r--indoteknik_custom/models/down_payment.py6
-rw-r--r--indoteknik_custom/views/down_payment.xml4
-rw-r--r--indoteknik_custom/views/ir_sequence.xml2
3 files changed, 8 insertions, 4 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py
index 04dfbbc4..7889ac53 100644
--- a/indoteknik_custom/models/down_payment.py
+++ b/indoteknik_custom/models/down_payment.py
@@ -541,6 +541,8 @@ class RealizationDownPayment(models.Model):
('done_realized', 'Done Realized')
], string='Status Realisasi', tracking=3, default='remaining')
+ date_done_not_realized = fields.Date(string='Tanggal Done Not Realized', tracking=3)
+
currency_id = fields.Many2one(
'res.currency', string='Currency',
default=lambda self: self.env.company.currency_id
@@ -617,6 +619,7 @@ class RealizationDownPayment(models.Model):
if self.done_status == 'remaining':
self.done_status = 'done_not_realized'
+ self.date_done_not_realized = fields.Date.today()
elif self.done_status == 'done_not_realized':
self.done_status = 'done_realized'
else:
@@ -650,7 +653,7 @@ class RealizationDownPayment(models.Model):
account_uang_muka = 403
# Tanggal pakai create_date atau hari ini
- account_date = self.create_date.date() if self.create_date else fields.Date.today()
+ account_date = self.date_done_not_realized
ref_label = f"Realisasi {self.pum_id.number} Biaya {self.pum_id.detail_note} ({cab_move.name})"
@@ -768,6 +771,7 @@ class RealizationDownPayment(models.Model):
rec.date_approved_pimpinan = now
rec.position_pimpinan = 'Pimpinan'
rec.status = 'approved'
+ rec.done_status = 'done_not_realized' # Set status done untuk realisasi
rec.message_post(
body=f"Approval <b>Pimpinan</b> oleh <b>{self.env.user.name}</b> "
diff --git a/indoteknik_custom/views/down_payment.xml b/indoteknik_custom/views/down_payment.xml
index 49306550..3c8d007e 100644
--- a/indoteknik_custom/views/down_payment.xml
+++ b/indoteknik_custom/views/down_payment.xml
@@ -10,7 +10,7 @@
type="object"
string="Realisasi"
class="btn-primary"
- attrs="{'invisible': [('status', '=', 'reject')]}"/>
+ attrs="{'invisible': [('status', 'not in', 'approved')]}"/>
<button name="action_draft"
string="Reset to Draft"
attrs="{'invisible': [('status', '!=', 'reject')]}"
@@ -19,7 +19,7 @@
type="object"
string="Reject"
class="btn-danger"
- attrs="{'invisible': [('status', 'in', ['approved','reject'])]}"/>
+ attrs="{'invisible': [('status', 'in', ['approved','reject','draft'])]}"/>
<button name="action_confirm_payment"
type="object"
string="Konfirmasi Pembayaran"
diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml
index 5fa3d2dd..372750f7 100644
--- a/indoteknik_custom/views/ir_sequence.xml
+++ b/indoteknik_custom/views/ir_sequence.xml
@@ -223,7 +223,7 @@
<field name="name">Down Payment Sequence</field>
<field name="code">down.payment</field>
<field name="prefix">PUM/%(year)s/%(month)s/</field>
- <field name="padding">5</field>
+ <field name="padding">4</field>
<field name="number_next">1</field>
<field name="number_increment">1</field>
<field name="active">True</field>