summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-06-13 13:46:23 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-06-13 13:46:23 +0700
commit1cca590f07fd84a33626e5fc965924c617d8e287 (patch)
treef7161fbd796ece132be48ba6bef79265b2dfe34b
parentb0effc107cd0dcb1d9f5a458a00b2c1170edf1e8 (diff)
Bug fix error input note on sale order line validation
-rwxr-xr-xindoteknik_custom/models/sale_order.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index e592326d..cefba3da 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -309,11 +309,11 @@ class SaleOrder(models.Model):
if not order.carrier_id:
raise UserError("Shipping Method harus diisi")
for line in order.order_line:
+ if not line.product_id or line.product_id.type == 'service':
+ continue
# must add product can sell validation
if not line.product_id.product_tmpl_id.sale_ok:
raise UserError('Product %s belum bisa dijual, harap hubungi finance' % line.product_id.display_name)
- if not line.product_id or line.product_id.type == 'service':
- continue
if line.product_id.id == 232383:
raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara'))
if not line.vendor_id or not line.purchase_price:
@@ -353,11 +353,11 @@ class SaleOrder(models.Model):
raise UserError("Shipping Method harus diisi")
# approval1 = approval2 = 0
for line in order.order_line:
+ if not line.product_id or line.product_id.type == 'service':
+ continue
# must add product can sell validation
if not line.product_id.product_tmpl_id.sale_ok:
raise UserError('Product %s belum bisa dijual, harap hubungi finance' % line.product_id.display_name)
- if not line.product_id or line.product_id.type == 'service':
- continue
if line.product_id.id == 232383:
raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara'))
if not line.vendor_id or not line.purchase_price or not line.purchase_tax_id: