From 2348a5f59243f685927e914185f4c1ebb8a492ec Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 15 Oct 2014 15:31:33 +0530 Subject: [PATCH 1/2] repost stock utility --- .../patches/v4_2/fix_gl_entries_for_stock_transactions.py | 2 +- erpnext/utilities/repost_stock.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py b/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py index 2de3daa27ee..a72b95480a5 100644 --- a/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py +++ b/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py @@ -7,7 +7,7 @@ from frappe.utils import flt def execute(): from erpnext.utilities.repost_stock import repost - repost(allow_zero_rate=True) + repost(allow_zero_rate=True, only_actual=True) warehouse_account = frappe.db.sql("""select name, master_name from tabAccount where ifnull(account_type, '') = 'Warehouse'""") diff --git a/erpnext/utilities/repost_stock.py b/erpnext/utilities/repost_stock.py index 4be95911c80..643bec986aa 100644 --- a/erpnext/utilities/repost_stock.py +++ b/erpnext/utilities/repost_stock.py @@ -9,7 +9,7 @@ from erpnext.stock.utils import update_bin from erpnext.stock.stock_ledger import update_entries_after from erpnext.accounts.utils import get_fiscal_year -def repost(allow_negative_stock=False, allow_zero_rate=False): +def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False): """ Repost everything! """ @@ -23,7 +23,7 @@ def repost(allow_negative_stock=False, allow_zero_rate=False): union select item_code, warehouse from `tabStock Ledger Entry`) a"""): try: - repost_stock(d[0], d[1], allow_zero_rate) + repost_stock(d[0], d[1], allow_zero_rate, only_actual) frappe.db.commit() except: frappe.db.rollback() @@ -33,10 +33,10 @@ def repost(allow_negative_stock=False, allow_zero_rate=False): frappe.db.get_value("Stock Settings", None, "allow_negative_stock")) frappe.db.auto_commit_on_many_writes = 0 -def repost_stock(item_code, warehouse, allow_zero_rate=False): +def repost_stock(item_code, warehouse, allow_zero_rate=False, only_actual=False): repost_actual_qty(item_code, warehouse, allow_zero_rate) - if item_code and warehouse: + if item_code and warehouse and not only_actual: update_bin_qty(item_code, warehouse, { "reserved_qty": get_reserved_qty(item_code, warehouse), "indented_qty": get_indented_qty(item_code, warehouse), From 26d096aa87f112b7ec0f8cda942d16097adc2e78 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 15 Oct 2014 16:04:39 +0600 Subject: [PATCH 2/2] bumped to version 4.7.2 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 3c9329b2771..64f6e28028a 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1 +1 @@ -__version__ = '4.7.1' +__version__ = '4.7.2' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index de6f096a131..fe989d85ddd 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.7.1" +app_version = "4.7.2" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index 11148e5a7de..e567ea2e76e 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "4.7.1" +version = "4.7.2" with open("requirements.txt", "r") as f: install_requires = f.readlines()