From b77eaf70532fadd18a87f5f5ed2ef8dabc3fc9dd Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Sat, 28 Jan 2017 13:18:49 +0530 Subject: [PATCH 1/2] [URGENT][FIX]Stock Controller fix --- erpnext/controllers/stock_controller.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index e167860234..9a3d82ee91 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -92,8 +92,10 @@ class StockController(AccountsController): sle.voucher_type, sle.voucher_no) sle.stock_value = flt(sle.qty_after_transaction) * flt(sle.valuation_rate) sle.stock_value_difference = sle.stock_value - sle.doctype="Stock Ledger Entry" - frappe.get_doc(sle).db_update() + if sle.name: + frappe.db.sql(""" update `tabStock Ledger Entry` set stock_value = %(stock_value)s, + valuation_rate = %(valuation_rate)s, stock_value_difference = %(stock_value_difference)s + where name = %(name)s""", (sle)) def validate_negative_stock(self, sle): if sle.qty_after_transaction < 0 and sle.actual_qty < 0: @@ -147,7 +149,7 @@ class StockController(AccountsController): def get_stock_ledger_details(self): stock_ledger = {} - for sle in frappe.db.sql("""select warehouse, stock_value_difference, + for sle in frappe.db.sql("""select name, warehouse, stock_value_difference, voucher_detail_no, item_code, posting_date, posting_time, actual_qty, qty_after_transaction from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""", (self.doctype, self.name), as_dict=True): From ce4a0b20abb380ae36595a9562c6a98b6556ef26 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 28 Jan 2017 14:44:32 +0600 Subject: [PATCH 2/2] bumped to version 7.2.18 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index eb03b5bbf1..360c4c70d4 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.2.17' +__version__ = '7.2.18' def get_default_company(user=None): '''Get default company for user'''