summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/advance_payment_request.py2
-rw-r--r--indoteknik_custom/models/refund_sale_order.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/indoteknik_custom/models/advance_payment_request.py b/indoteknik_custom/models/advance_payment_request.py
index d0805598..ed0b0809 100644
--- a/indoteknik_custom/models/advance_payment_request.py
+++ b/indoteknik_custom/models/advance_payment_request.py
@@ -62,6 +62,7 @@ class AdvancePaymentRequest(models.Model):
status_pay_down_payment = fields.Selection([
('pending', 'Pending'),
('payment', 'Payment'),
+ ('cancel','Cancel')
], string='Status Pembayaran', default='pending', tracking=3)
name_approval_departement = fields.Char(string='Approval Departement')
@@ -853,6 +854,7 @@ class AdvancePaymentCancelWizard(models.TransientModel):
raise UserError("Tidak bisa melakukan cancel karena Jurnal (Move ID) sudah terbentuk.")
request.write({'status': 'cancel'})
+ request.write({'status_pay_down_payment': 'cancel'})
request.message_post(
body=f"Pengajuan telah <b>DIBATALKAN</b> oleh {self.env.user.name}.<br/>"
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index c22e84ab..722a125e 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -592,7 +592,9 @@ class RefundSaleOrder(models.Model):
for rec in self:
move_links = []
- invoice_ids = rec.sale_order_ids.mapped('invoice_ids')
+ invoice_ids = rec.sale_order_ids.mapped('invoice_ids').filtered(
+ lambda inv: inv.state == 'posted'
+ )
moves = self.env['account.move'].search([
('sale_id', 'in', rec.sale_order_ids.ids),