[fix] [refactor] demo for v8 and remove purchase common

This commit is contained in:
Rushabh Mehta
2017-03-31 12:44:29 +05:30
committed by Nabin Hait
parent dc89916aa9
commit cc8b2b2fdb
32 changed files with 233 additions and 683 deletions

View File

@@ -3,19 +3,10 @@
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe import _
from frappe.utils import flt
from frappe.utils import get_datetime_str, nowdate
def get_company_currency(company):
currency = frappe.db.get_value("Company", company, "default_currency", cache=True)
if not currency:
currency = frappe.db.get_default("currency")
if not currency:
throw(_('Please specify Default Currency in Company Master and Global Defaults'))
return currency
def get_root_of(doctype):
"""Get root element of a DocType with a tree structure"""
result = frappe.db.sql_list("""select name from `tab%s`