summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/requisition.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-10 13:18:18 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-10 13:18:18 +0700
commit3a153b5deaf2c11d2deb8aca2318357e4496ac96 (patch)
tree42c4298b6e45a6d366470d26b9d2905c04946dc9 /indoteknik_custom/models/requisition.py
parent8e6e3f900daac1b56cc7e101c7c491ef7eb320f5 (diff)
parentd746dacecc64c2effb9166b54808f0e81ea8303f (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models/requisition.py')
-rw-r--r--indoteknik_custom/models/requisition.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py
index 64ef4fc8..748642eb 100644
--- a/indoteknik_custom/models/requisition.py
+++ b/indoteknik_custom/models/requisition.py
@@ -85,7 +85,7 @@ class Requisition(models.Model):
('product_id', '=', prod_line.product_id.id), ('order_id', '=', req.sale_order_id.id)
])
if match:
- raise UserError ('Product sudah di SO tidak approve/create PO')
+ raise UserError ('Product sudah ada di SO tidak bisa approve/create PO')
def button_approve(self):
@@ -108,7 +108,7 @@ class Requisition(models.Model):
raise UserError('Tidak ada Lines, belum bisa create PO')
if self.is_po:
raise UserError('Sudah pernah di create PO')
- if not self.sale_order_id:
+ if not self.sale_order_id and (not self.sales_approve or not self.merchandise_approve):
raise UserError('Tidak ada link dengan Sales Order, tidak bisa dihitung sebagai Plafon Qty di PO')
vendor_ids = self.env['requisition.line'].read_group([