diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-06 08:55:16 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-06 08:55:16 +0700 |
| commit | 1ac873d214e2f93c63102e16e868944947156b6e (patch) | |
| tree | 06fe05c0f18eb433a81021a10d98bc5b444ac0db | |
| parent | 1ca5e38778a8b10e03018a32d76c2689d02eb7d1 (diff) | |
refactor api product altama
| -rw-r--r-- | indoteknik_custom/models/product_sla.py | 9 |
1 files 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), |
