diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 13:20:11 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-22 13:20:11 +0700 |
| commit | 71c9d880437b4ef17684b1b46dfb056a64782275 (patch) | |
| tree | db3b9382de6fb7bc183ea7cf3b527d09d6e3cfd1 | |
| parent | 2e3e5853ce9fc3e9568eea3a673c2a154b8de9da (diff) | |
| parent | 56a252e8accd9c330826ea2e8e596792b5925af9 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into cr_renca_find
merge
| -rw-r--r-- | indoteknik_custom/models/requisition.py | 10 |
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), |
