summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/requisition.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-09 14:43:31 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-09 14:43:31 +0700
commite8291422441d48909252471282c4b72372cccefb (patch)
tree60e1e280dc5bfc8d670523b04ff4582a8a35e9bb /indoteknik_custom/models/requisition.py
parentff058e22f64cd3e2dbd69d835f68877f530820c3 (diff)
parentae961c97d736359f6611db82ee484707f581ab0f (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into magento-solr-v1
Diffstat (limited to 'indoteknik_custom/models/requisition.py')
-rw-r--r--indoteknik_custom/models/requisition.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py
index 748642eb..c0489adc 100644
--- a/indoteknik_custom/models/requisition.py
+++ b/indoteknik_custom/models/requisition.py
@@ -90,7 +90,7 @@ class Requisition(models.Model):
def button_approve(self):
state = ['done', 'sale']
- self.check_product_line_to_so()
+ # self.check_product_line_to_so()
if self.sale_order_id.state in state:
raise UserError('SO sudah Confirm, akan berakibat double Purchase melalui PJ')
if self.env.user.id not in [21, 19, 28]:
@@ -101,15 +101,17 @@ class Requisition(models.Model):
self.merchandise_approve = True
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')
+ # self.check_product_line_to_so()
+ 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),