summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-06-07 11:02:03 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-06-07 11:02:03 +0700
commitd3538371691a43efbd5527b746c942bdef9fd1ba (patch)
tree1deefef8605e80436a68f53ceedc3aeb5eb546e8 /indoteknik_custom/models/purchase_order.py
parent55fb073416a7f8504c3819178aa7b6883304335f (diff)
(andri) Pada PO, CAB tidak tampil jika statusnya bukan posted
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 27f1aebd..004a1fa4 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -89,6 +89,14 @@ class PurchaseOrder(models.Model):
store_name = fields.Char(string='Nama Toko')
purchase_order_count = fields.Integer('Purchase Order Count', related='partner_id.purchase_order_count')
+ is_cab_visible = fields.Boolean(string='Tampilkan Tombol CAB', compute='_compute_is_cab_visible')
+
+ @api.depends('move_id.state')
+ def _compute_is_cab_visible(self):
+ for order in self:
+ move = order.move_id
+ order.is_cab_visible = bool(move and move.state == 'posted')
+
def action_view_journal_uangmuka(self):
self.ensure_one()
if not self.move_id: