summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/requisition.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py
index 748642eb..832e4c72 100644
--- a/indoteknik_custom/models/requisition.py
+++ b/indoteknik_custom/models/requisition.py
@@ -102,14 +102,16 @@ class Requisition(models.Model):
def create_po_from_requisition(self):
self.check_product_line_to_so()
- if not self.sales_approve and 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):
- raise UserError('Tidak ada link dengan Sales Order, tidak bisa dihitung sebagai Plafon Qty di PO')
+ 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),