mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: negative stock issue for higher precision
(cherry picked from commit 87be020c78)
This commit is contained in:
committed by
Mergify
parent
6f1616bc95
commit
0e79610a3f
@@ -1524,6 +1524,23 @@ class TestDeliveryNote(FrappeTestCase):
|
|||||||
|
|
||||||
frappe.db.set_single_value("System Settings", "float_precision", original_flt_precision)
|
frappe.db.set_single_value("System Settings", "float_precision", original_flt_precision)
|
||||||
|
|
||||||
|
def test_negative_stock_with_higher_precision(self):
|
||||||
|
original_flt_precision = frappe.db.get_default("float_precision")
|
||||||
|
frappe.db.set_single_value("System Settings", "float_precision", 7)
|
||||||
|
|
||||||
|
item_code = make_item(
|
||||||
|
"Test Negative Stock High Precision Item", properties={"is_stock_item": 1, "valuation_rate": 1}
|
||||||
|
).name
|
||||||
|
dn = create_delivery_note(
|
||||||
|
item_code=item_code,
|
||||||
|
qty=0.0000010,
|
||||||
|
do_not_submit=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertRaises(frappe.ValidationError, dn.submit)
|
||||||
|
|
||||||
|
frappe.db.set_single_value("System Settings", "float_precision", original_flt_precision)
|
||||||
|
|
||||||
|
|
||||||
def create_delivery_note(**args):
|
def create_delivery_note(**args):
|
||||||
dn = frappe.new_doc("Delivery Note")
|
dn = frappe.new_doc("Delivery Note")
|
||||||
|
|||||||
Reference in New Issue
Block a user