[minor] remove hardcoded flt precision and use system default (#9250)
* possible fix * use system default precision for flt
This commit is contained in:
parent
26a39610ca
commit
489ab6d70d
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import flt, getdate
|
from frappe.utils import flt, cint, getdate
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
@ -158,8 +158,9 @@ def filter_items_with_no_transactions(iwb_map):
|
|||||||
qty_dict = iwb_map[(company, item, warehouse)]
|
qty_dict = iwb_map[(company, item, warehouse)]
|
||||||
|
|
||||||
no_transactions = True
|
no_transactions = True
|
||||||
|
float_precision = cint(frappe.db.get_default("float_precision")) or 3
|
||||||
for key, val in qty_dict.items():
|
for key, val in qty_dict.items():
|
||||||
val = flt(val, 3)
|
val = flt(val, float_precision)
|
||||||
qty_dict[key] = val
|
qty_dict[key] = val
|
||||||
if key != "val_rate" and val:
|
if key != "val_rate" and val:
|
||||||
no_transactions = False
|
no_transactions = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user