summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-15 15:46:50 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-15 15:46:50 +0700
commit6026ac42425658a2dc1a1c1e34e79a6c021a2e24 (patch)
treed660011e84c894c0a9b8975a9a653ef1e87a3a07
parent96b727403891f0cabcc65c9147fb5bd7ed9b33f2 (diff)
parentfe5b09c1aa98723a3e0a3cf8174d6bc688c21bae (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into magento-solr-v1
-rw-r--r--indoteknik_custom/models/advance_payment_request.py2
-rw-r--r--indoteknik_custom/models/refund_sale_order.py4
-rw-r--r--indoteknik_custom/models/stock_picking.py2
-rw-r--r--indoteknik_custom/views/advance_payment_request.xml11
4 files changed, 13 insertions, 6 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),
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 2465fa96..c8f7bb5b 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1685,7 +1685,7 @@ class StockPicking(models.Model):
])
for line in po.order_sales_match_line:
- if not line.bu_pick:
+ if not line.bu_pick and line.hold_outgoing_so:
continue
line.bu_pick.action_assign()
diff --git a/indoteknik_custom/views/advance_payment_request.xml b/indoteknik_custom/views/advance_payment_request.xml
index b1d20406..8bbe6f82 100644
--- a/indoteknik_custom/views/advance_payment_request.xml
+++ b/indoteknik_custom/views/advance_payment_request.xml
@@ -56,7 +56,8 @@
</header>
<sheet>
<widget name="web_ribbon" title="Payment" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'payment'), ('status', '=', 'draft')]}"/>
- <widget name="web_ribbon" title="Pending" bg_color="bg-danger" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'pending'), ('status', '=', 'draft')]}"/>
+ <widget name="web_ribbon" title="Pending" bg_color="bg-warning" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'pending'), ('status', '=', 'draft')]}"/>
+ <widget name="web_ribbon" title="Cancel" bg_color="bg-danger" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'cancel'), ('status', '=', 'draft')]}"/>
<div class="oe_button_box" name="button_box" style="right: 150px;">
<field name="has_settlement" invisible="1"/>
<button name="action_realisasi_pum"
@@ -113,9 +114,10 @@
<field name="approved_by" readonly="1"/>
<field name="create_date" readonly="1"/>
<field name="status_pay_down_payment"
- readonly="1"
+ readonly="1"
decoration-success="status_pay_down_payment == 'payment'"
- decoration-danger="status_pay_down_payment == 'pending'"
+ decoration-warning="status_pay_down_payment == 'pending'"
+ decoration-danger="status_pay_down_payment == 'cancel'"
widget="badge" invisible = "1"/>
</group>
<group string="Bukti Transfer">
@@ -212,7 +214,8 @@
<field name="status_pay_down_payment"
readonly="1"
decoration-success="status_pay_down_payment == 'payment'"
- decoration-danger="status_pay_down_payment == 'pending'"
+ decoration-warning="status_pay_down_payment == 'pending'"
+ decoration-danger="status_pay_down_payment == 'cancel'"
widget="badge"/>
<field name="days_remaining" readonly="1" widget="badge" optional="hide"/>
<field name="estimated_return_date" widget="badge" optional="hide"/>