mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-28 14:18:24 +00:00
[fix] [refactor] demo for v8 and remove purchase common
This commit is contained in:
committed by
Nabin Hait
parent
dc89916aa9
commit
cc8b2b2fdb
@@ -123,7 +123,7 @@ class Company(Document):
|
||||
{"company": self.name, "account_type": "Receivable", "is_group": 0}))
|
||||
frappe.db.set(self, "default_payable_account", frappe.db.get_value("Account",
|
||||
{"company": self.name, "account_type": "Payable", "is_group": 0}))
|
||||
|
||||
|
||||
def validate_coa_input(self):
|
||||
if self.create_chart_of_accounts_based_on == "Existing Company":
|
||||
self.chart_of_accounts = None
|
||||
@@ -294,7 +294,3 @@ def get_name_with_abbr(name, company):
|
||||
parts.append(company_abbr)
|
||||
|
||||
return " - ".join(parts)
|
||||
|
||||
def get_company_currency(company):
|
||||
return frappe.local_cache("company_currency", company,
|
||||
lambda: frappe.db.get_value("Company", company, "default_currency"))
|
||||
|
||||
@@ -177,6 +177,7 @@ def set_defaults(args):
|
||||
selling_settings.cust_master_name = "Customer Name"
|
||||
selling_settings.so_required = "No"
|
||||
selling_settings.dn_required = "No"
|
||||
selling_settings.allow_multiple_items = 1
|
||||
selling_settings.save()
|
||||
|
||||
buying_settings = frappe.get_doc("Buying Settings")
|
||||
@@ -184,6 +185,7 @@ def set_defaults(args):
|
||||
buying_settings.po_required = "No"
|
||||
buying_settings.pr_required = "No"
|
||||
buying_settings.maintain_same_rate = 1
|
||||
buying_settings.allow_multiple_items = 1
|
||||
buying_settings.save()
|
||||
|
||||
notification_control = frappe.get_doc("Notification Control")
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user