From e60bfff5a9ec49545370b1804b33535b5f373b60 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 16 Oct 2024 14:56:12 +0700 Subject: cr approval unreserve --- indoteknik_custom/models/approval_unreserve.py | 2 +- indoteknik_custom/models/purchase_order.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/approval_unreserve.py b/indoteknik_custom/models/approval_unreserve.py index 85dfffff..07ddda1f 100644 --- a/indoteknik_custom/models/approval_unreserve.py +++ b/indoteknik_custom/models/approval_unreserve.py @@ -68,7 +68,7 @@ class ApprovalUnreserve(models.Model): if not move: raise UserError("Product tidak ada di destination picking") - qty_unreserve = line.unreserve_qty + move.forecast_availability + qty_unreserve = line.unreserve_qty + move.reserved_availability if move.product_uom_qty < qty_unreserve: raise UserError("Quantity yang di unreserve melebihi quantity yang ada") diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 21f3265e..f8af409f 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -509,10 +509,10 @@ class PurchaseOrder(models.Model): raise UserError("Hanya Merchandiser yang bisa approve") if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader: - raise UserError("Beda Margin dengan Sales, harus approval Manager") + raise UserError("Beda Margin dengan Sales, harus approval Merchandise") if not self.from_apo: if not self.sale_order_id and self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader: - raise UserError("Tidak ada link dengan SO, harus approval Manager") + raise UserError("Tidak ada link dengan SO, harus approval Merchandise") send_email = False self.add_product_to_pricelist() -- cgit v1.2.3