From 5e801955f13e9cb7cf6911f7d1d1f3fa4983e1b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Nov 2017 18:01:56 +0530 Subject: [PATCH 1/5] Update asset_category.json --- erpnext/accounts/doctype/asset_category/asset_category.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/asset_category/asset_category.json b/erpnext/accounts/doctype/asset_category/asset_category.json index 74762d790c..4aa6a7b449 100644 --- a/erpnext/accounts/doctype/asset_category/asset_category.json +++ b/erpnext/accounts/doctype/asset_category/asset_category.json @@ -59,7 +59,7 @@ "label": "Depreciation Method", "length": 0, "no_copy": 0, - "options": "\nStraight Line\nDouble Declining Balance", + "options": "\nStraight Line\nDouble Declining Balance\nManual", "permlevel": 0, "precision": "", "print_hide": 0, @@ -284,4 +284,4 @@ "sort_order": "DESC", "track_changes": 0, "track_seen": 0 -} \ No newline at end of file +} From 7a294e6ef550619d278ac3ccca684f058c413122 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Nov 2017 18:02:22 +0530 Subject: [PATCH 2/5] Update asset_category.json --- erpnext/accounts/doctype/asset_category/asset_category.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/asset_category/asset_category.json b/erpnext/accounts/doctype/asset_category/asset_category.json index 4aa6a7b449..161ac78370 100644 --- a/erpnext/accounts/doctype/asset_category/asset_category.json +++ b/erpnext/accounts/doctype/asset_category/asset_category.json @@ -228,7 +228,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-02-17 16:09:52.955332", + "modified": "2017-11-30 16:09:52.955332", "modified_by": "Administrator", "module": "Accounts", "name": "Asset Category", From b1ac979ac541162511887cdd8e7084d1c5d03bfb Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 1 Dec 2017 16:09:02 +0530 Subject: [PATCH 3/5] [fix] Do not allow zero valuation rate for serial no and fetch previous valuation rate for serial no (#11817) --- erpnext/stock/stock_ledger.py | 7 +++++++ erpnext/stock/utils.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 180ccbb3e2..647c9faf02 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -230,6 +230,13 @@ class update_entries_after(object): # else it remains the same as that of previous entry self.valuation_rate = new_stock_value / new_stock_qty + if not self.valuation_rate and sle.voucher_detail_no: + allow_zero_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no) + if not allow_zero_rate: + self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, + sle.voucher_type, sle.voucher_no, self.allow_zero_rate, + currency=erpnext.get_company_currency(sle.company)) + def get_moving_average_values(self, sle): actual_qty = flt(sle.actual_qty) new_stock_qty = flt(self.qty_after_transaction) + actual_qty diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 01a18b90a4..6f091446d9 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -126,7 +126,7 @@ def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False): def get_incoming_rate(args): """Get Incoming Rate based on valuation method""" from erpnext.stock.stock_ledger import get_previous_sle - + if isinstance(args, basestring): args = json.loads(args) @@ -141,6 +141,8 @@ def get_incoming_rate(args): return 0.0 previous_stock_queue = json.loads(previous_sle.get('stock_queue', '[]') or '[]') in_rate = get_fifo_rate(previous_stock_queue, args.get("qty") or 0) if previous_stock_queue else 0 + if not in_rate and not previous_stock_queue: + in_rate = previous_sle.get('valuation_rate') or 0 elif valuation_method == 'Moving Average': in_rate = previous_sle.get('valuation_rate') or 0 From f4d9af1ab9a48f6f60403ff1676eee245ec2f06a Mon Sep 17 00:00:00 2001 From: Jamsheer Date: Fri, 1 Dec 2017 16:10:39 +0530 Subject: [PATCH 4/5] Fix Patch - remove company from patient (#11819) --- erpnext/patches/v9_2/remove_company_from_patient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v9_2/remove_company_from_patient.py b/erpnext/patches/v9_2/remove_company_from_patient.py index ad9c9c5fe0..1ce344501d 100644 --- a/erpnext/patches/v9_2/remove_company_from_patient.py +++ b/erpnext/patches/v9_2/remove_company_from_patient.py @@ -1,5 +1,6 @@ import frappe def execute(): - if 'company' in frappe.db.get_table_columns("Patient"): - frappe.db.sql("alter table `tabPatient` drop column company") + if frappe.db.exists("DocType", "Patient"): + if 'company' in frappe.db.get_table_columns("Patient"): + frappe.db.sql("alter table `tabPatient` drop column company") From a067ddbc202ab41df0097c378c8dca42ad4738ba Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 1 Dec 2017 16:52:43 +0600 Subject: [PATCH 5/5] bumped to version 9.2.19 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 2a06423d36..4679a4a37a 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.18' +__version__ = '9.2.19' def get_default_company(user=None): '''Get default company for user'''