summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-12-05 16:54:23 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-12-05 16:54:23 +0700
commit813a29fdcd7d95e6fcac6d4445b4683a2bea4def (patch)
treeb1346152dc29ddbc07c26fcabb6075c4f3173711 /indoteknik_custom/models
parent8ee7bd9211a75809e1819de32ddf974c3736ebde (diff)
parentf7c99e518ca9489e118f4c68f2d13ce91b0f1e84 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into cr_renca_find
merge
Diffstat (limited to 'indoteknik_custom/models')
-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([