From 29fa0a9a17095f8f90129985ae994369690d333e Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 26 Jun 2017 13:14:52 +0530 Subject: [PATCH 1/2] [fix] patch fixes --- erpnext/patches/v8_0/create_domain_docs.py | 2 +- erpnext/patches/v8_0/move_perpetual_inventory_setting.py | 2 +- erpnext/patches/v8_0/save_system_settings.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v8_0/create_domain_docs.py b/erpnext/patches/v8_0/create_domain_docs.py index 2f376db3d7..cdd3117f76 100644 --- a/erpnext/patches/v8_0/create_domain_docs.py +++ b/erpnext/patches/v8_0/create_domain_docs.py @@ -21,7 +21,7 @@ def execute(): condition = "" company = erpnext.get_default_company() if company: - condition = " and name='{0}'".format(company) + condition = " and name='{0}'".format(frappe.db.escape(company)) domains = frappe.db.sql_list("select distinct domain from `tabCompany` where domain != 'Other' {0}".format(condition)) diff --git a/erpnext/patches/v8_0/move_perpetual_inventory_setting.py b/erpnext/patches/v8_0/move_perpetual_inventory_setting.py index 594a15c500..78322d4575 100644 --- a/erpnext/patches/v8_0/move_perpetual_inventory_setting.py +++ b/erpnext/patches/v8_0/move_perpetual_inventory_setting.py @@ -10,4 +10,4 @@ def execute(): for data in frappe.get_all('Company', fields = ["name"]): doc = frappe.get_doc('Company', data.name) doc.enable_perpetual_inventory = enabled - doc.save(ignore_permissions=True) \ No newline at end of file + doc.db_update() \ No newline at end of file diff --git a/erpnext/patches/v8_0/save_system_settings.py b/erpnext/patches/v8_0/save_system_settings.py index d91e4c1209..d479ece8a6 100644 --- a/erpnext/patches/v8_0/save_system_settings.py +++ b/erpnext/patches/v8_0/save_system_settings.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import frappe +from frappe.utils import cint def execute(): """ @@ -10,6 +11,10 @@ def execute(): """ frappe.reload_doc("core", "doctype", "system_settings") - doc = frappe.get_doc("System Settings", "System Settings") + doc = frappe.get_doc("System Settings") doc.flags.ignore_mandatory = True + + if cint(doc.currency_precision) == 0: + doc.currency_precision = '' + doc.save(ignore_permissions=True) From 095701e86bf8c6df5d41dcac66224cf143494209 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 26 Jun 2017 14:25:59 +0600 Subject: [PATCH 2/2] bumped to version 8.1.3 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 1a5b25c3cf..36bf1bf51e 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.1.2' +__version__ = '8.1.3' def get_default_company(user=None):