summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-09-13 14:06:10 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-09-13 14:06:10 +0700
commit65e9e2bb3886b5275263a3b9ffce7c04757da26d (patch)
treef58f9f994ea93ffd9867e89dd2459622f38d1ed9
parent6c624a595d961138cf4e65724bd401e374ee6642 (diff)
add produk sementara validation
-rwxr-xr-xindoteknik_custom/models/sale_order.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 6f901809..08349bd3 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -46,6 +46,13 @@ class SaleOrder(models.Model):
# self.approval_status = False
# return super(SaleOrder, self).action_cancel()
+ def action_confirm(self):
+ for line in self.order_line:
+ if line.product_id.id == 232383:
+ raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara'))
+ res = super(SaleOrder, self).action_confirm()
+ return res
+
def compute_total_margin(self):
for order in self:
total_margin = total_percent_margin = 0