diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-13 13:46:23 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-13 13:46:23 +0700 |
| commit | 1cca590f07fd84a33626e5fc965924c617d8e287 (patch) | |
| tree | f7161fbd796ece132be48ba6bef79265b2dfe34b | |
| parent | b0effc107cd0dcb1d9f5a458a00b2c1170edf1e8 (diff) | |
Bug fix error input note on sale order line validation
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 8 |
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: |
