summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/requisition.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py
index f292b760..c2f8080f 100644
--- a/indoteknik_custom/models/requisition.py
+++ b/indoteknik_custom/models/requisition.py
@@ -102,15 +102,14 @@ class Requisition(models.Model):
def create_po_from_requisition(self):
self.check_product_line_to_so()
- if not self.sales_approve or not self.merchandise_approve:
- raise UserError('Harus Di Approve oleh Darren atau Rafly')
+ if not (self.sales_approve or self.merchandise_approve):
+ raise UserError('Tidak bisa create PO karena belukm diapprove oleh Darren atau Rafly')
if not self.requisition_lines:
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 and (not self.sales_approve or not self.merchandise_approve):
+ if not self.sale_order_id and not self.sales_approve or 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([
('requisition_id', '=', self.id),
('partner_id', '!=', False)