Merge pull request #9463 from saurabh6790/v8_1_patch_fixes

[fix] patch fixes
This commit is contained in:
Saurabh 2017-06-26 13:52:23 +05:30 committed by GitHub
commit dccceb44f9
3 changed files with 8 additions and 3 deletions

View File

@ -21,7 +21,7 @@ def execute():
condition = "" condition = ""
company = erpnext.get_default_company() company = erpnext.get_default_company()
if 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)) domains = frappe.db.sql_list("select distinct domain from `tabCompany` where domain != 'Other' {0}".format(condition))

View File

@ -10,4 +10,4 @@ def execute():
for data in frappe.get_all('Company', fields = ["name"]): for data in frappe.get_all('Company', fields = ["name"]):
doc = frappe.get_doc('Company', data.name) doc = frappe.get_doc('Company', data.name)
doc.enable_perpetual_inventory = enabled doc.enable_perpetual_inventory = enabled
doc.save(ignore_permissions=True) doc.db_update()

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import cint
def execute(): def execute():
""" """
@ -10,6 +11,10 @@ def execute():
""" """
frappe.reload_doc("core", "doctype", "system_settings") 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 doc.flags.ignore_mandatory = True
if cint(doc.currency_precision) == 0:
doc.currency_precision = ''
doc.save(ignore_permissions=True) doc.save(ignore_permissions=True)