diff --git a/erpnext/__version__.py b/erpnext/__version__.py index e893b1fc0d..2bdfe47e06 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1 +1 @@ -__version__ = '4.6.1' +__version__ = '4.6.2' diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 83853dd7f3..842409f715 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -112,6 +112,6 @@ class TestPurchaseOrder(unittest.TestCase): test_recurring_document(self, test_records) -test_dependencies = ["BOM"] +test_dependencies = ["BOM", "Item Price"] test_records = frappe.get_test_records('Purchase Order') diff --git a/erpnext/hooks.py b/erpnext/hooks.py index b095984dda..0f677a0e75 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -4,7 +4,7 @@ app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "4.6.1" +app_version = "4.6.2" error_report_email = "support@erpnext.com" diff --git a/erpnext/stock/doctype/item_price/test_records.json b/erpnext/stock/doctype/item_price/test_records.json index b4ceb92172..36870cdf7e 100644 --- a/erpnext/stock/doctype/item_price/test_records.json +++ b/erpnext/stock/doctype/item_price/test_records.json @@ -16,5 +16,11 @@ "item_code": "_Test Item 2", "price_list": "_Test Price List Rest of the World", "price_list_rate": 20 + }, + { + "doctype": "Item Price", + "item_code": "_Test Item Home Desktop 100", + "price_list": "_Test Price List", + "price_list_rate": 1000 } ] diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 67f621aa01..69751a2824 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -151,6 +151,6 @@ def set_perpetual_inventory(enable=1): accounts_settings.save() -test_dependencies = ["BOM"] +test_dependencies = ["BOM", "Item Price"] test_records = frappe.get_test_records('Purchase Receipt') diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 2956170010..7dc8d837bb 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -275,7 +275,7 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): incoming_rate = flt(sle.incoming_rate) actual_qty = flt(sle.actual_qty) - intialize_stock_queue(stock_queue, sle.item_code, sle.warehouse) + intialize_stock_queue(stock_queue, sle.item_code, sle.warehouse, actual_qty) if actual_qty > 0: if stock_queue[-1][0] > 0: @@ -289,7 +289,7 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): else: qty_to_pop = abs(actual_qty) while qty_to_pop: - intialize_stock_queue(stock_queue, sle.item_code, sle.warehouse) + intialize_stock_queue(stock_queue, sle.item_code, sle.warehouse, actual_qty) batch = stock_queue[0] @@ -318,9 +318,9 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): return abs(valuation_rate) -def intialize_stock_queue(stock_queue, item_code, warehouse): +def intialize_stock_queue(stock_queue, item_code, warehouse, actual_qty): if not stock_queue: - estimated_val_rate = get_valuation_rate(item_code, warehouse) + estimated_val_rate = get_valuation_rate(item_code, warehouse) if actual_qty < 0 else 0 stock_queue.append([0, estimated_val_rate]) def _raise_exceptions(args, verbose=1): diff --git a/setup.py b/setup.py index 204d833b93..34207e86f7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "4.6.1" +version = "4.6.2" with open("requirements.txt", "r") as f: install_requires = f.readlines()