diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 12:04:51 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 12:04:51 +0700 |
| commit | 56a252e8accd9c330826ea2e8e596792b5925af9 (patch) | |
| tree | 3bdaea817867903e010a95c1ad1208e45fd36e71 | |
| parent | b48907913127a1213c183a02d7202bcd61482dd5 (diff) | |
<Miqdad> fix
| -rw-r--r-- | indoteknik_custom/models/requisition.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py index c2f8080f..832e4c72 100644 --- a/indoteknik_custom/models/requisition.py +++ b/indoteknik_custom/models/requisition.py @@ -108,8 +108,11 @@ 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 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') + 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) |
