From 87a29b3262e0a952882199d4560f820805069d11 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 27 Jul 2023 10:46:42 +0700 Subject: Pastikan produk sementara tidak bisa di approve di SO pada saat ask approval atau confirm --- indoteknik_custom/models/sale_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 552f1b0a..12043996 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -327,7 +327,6 @@ class SaleOrder(models.Model): order.is_warning = False def sale_order_approve(self): - # raise UserError("Bisa langsung Confirm") self.check_due() for order in self: @@ -357,6 +356,8 @@ class SaleOrder(models.Model): if not order.carrier_id: raise UserError("Shipping Method harus diisi") for line in order.order_line: + if line.product_id.id == 385544: + raise UserError('Produk Sementara Tidak Bisa Di Confirm atau Ask Approval') if not line.product_id or line.product_id.type == 'service': continue # must add product can sell validation -- cgit v1.2.3 From b9b91b0e8a37ca96748304afea83812884b4811e Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 27 Jul 2023 13:06:15 +0700 Subject: fix source so --- indoteknik_custom/views/sale_order.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index ae16f649..3b5bc4c5 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -58,7 +58,6 @@ [('id', 'in', [32, 59, 60, 61])] - 1 -- cgit v1.2.3 From c6c59089732d912d9bc9c8a95028ddb1addcfb5a Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 27 Jul 2023 13:11:17 +0700 Subject: fix source so --- indoteknik_custom/views/sale_order.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 3b5bc4c5..9ff000e7 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -58,6 +58,8 @@ [('id', 'in', [32, 59, 60, 61])] + {'required':['|',('create_date', '>', '2023-07-30'), ('create_date', '=', False)]} + -- cgit v1.2.3