From 1ac873d214e2f93c63102e16e868944947156b6e Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 6 Jul 2023 08:55:16 +0700 Subject: refactor api product altama --- indoteknik_custom/models/product_sla.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/indoteknik_custom/models/product_sla.py b/indoteknik_custom/models/product_sla.py index 1ef1e0fb..c09c5018 100644 --- a/indoteknik_custom/models/product_sla.py +++ b/indoteknik_custom/models/product_sla.py @@ -53,13 +53,8 @@ class ProductSla(models.Model): qty_available += stock.quantity qty_available -= 10 - total_stock_moves = len(self.product_variant_id.stock_move_ids) - - if total_stock_moves > 0: - if qty_available > 10: - self.sla = '1 Hari' - elif qty_available <= 0: - self.sla = 'barang mempunyai stock move tetapi tidak ada qty available' + if qty_available > 10: + self.sla = '1 Hari' query = [ ('product_id', '=', self.product_variant_id.id), -- cgit v1.2.3