diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-10-04 14:55:28 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-10-04 14:55:28 +0700 |
| commit | b313cffd7c67da80a460eb693e2cbcc4f0e0455b (patch) | |
| tree | f96b200ca777dbfdc26fe202239058d3d41a79ea | |
| parent | c4f30a0164ada85a9a4a25cdd03ee7c4e42774a0 (diff) | |
calculate margin if purchase tax is empty
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 87ed0047..05e3e19f 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -54,8 +54,8 @@ class SaleOrder(models.Model): 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: - raise UserError(_('Isi Vendor, Harga Beli, dan Tax sebelum Request Approval')) + if not line.vendor_id or not line.purchase_price: + raise UserError(_('Isi Vendor dan Harga Beli sebelum Request Approval')) # if line.item_percent_margin <= 15 and not self.env.user.is_leader: # akbar or tyas # approval2 += 1 # elif line.item_percent_margin <= 25 and not self.env.user.is_leader and not self.env.user.is_sales_manager: @@ -167,7 +167,7 @@ class SaleOrderLine(models.Model): for line in self: if not line.product_id or line.product_id.type == 'service' \ or line.price_unit <= 0 or line.product_uom_qty <= 0 \ - or not line.vendor_id or not line.purchase_tax_id: + or not line.vendor_id: line.item_margin = 0 line.item_percent_margin = 0 continue |
