Merge branch 'staging' into develop

This commit is contained in:
Sagar Vora
2019-01-29 18:39:14 +05:30
355 changed files with 6308 additions and 4924 deletions

View File

@@ -206,6 +206,8 @@ erpnext.company.setup_queries = function(frm) {
["default_payroll_payable_account", {"root_type": "Liability"}],
["round_off_account", {"root_type": "Expense"}],
["write_off_account", {"root_type": "Expense"}],
["discount_allowed_account", {"root_type": "Expense"}],
["discount_received_account", {"root_type": "Income"}],
["exchange_gain_loss_account", {"root_type": "Expense"}],
["unrealized_exchange_gain_loss_account", {"root_type": "Expense"}],
["accumulated_depreciation_account",

View File

@@ -1250,6 +1250,72 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_allowed_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Discount Allowed Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discount_received_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Discount Received Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -2903,7 +2969,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2018-10-24 12:57:46.776452",
"modified": "2019-01-15 13:29:54.510379",
"modified_by": "Administrator",
"module": "Setup",
"name": "Company",

View File

@@ -94,6 +94,9 @@ class Company(NestedSet):
if frappe.flags.country_change:
install_country_fixtures(self.name)
self.create_default_tax_template()
if not frappe.db.get_value("Department", {"company": self.name}):
from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures
@@ -336,6 +339,9 @@ class Company(NestedSet):
frappe.db.sql("delete from tabDepartment where company=%s", self.name)
frappe.db.sql("delete from `tabTax Withholding Account` where company=%s", self.name)
frappe.db.sql("delete from `tabSales Taxes and Charges Template` where company=%s", self.name)
frappe.db.sql("delete from `tabPurchase Taxes and Charges Template` where company=%s", self.name)
@frappe.whitelist()
def enqueue_replace_abbr(company, old, new):
kwargs = dict(company=company, old=old, new=new)

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@@ -22,7 +22,7 @@
<ul class="list-unstyled">
<li><a class="text-muted" href="#">{%= __("Go to the Desktop and start using ERPNext") %}</a></li>
<li><a class="text-muted" href="#modules/Learn">{%= __("View a list of all the help videos") %}</a></li>
<li><a class="text-muted" href="https://erpnext.org/docs/user" target="_blank">{%= __("Read the ERPNext Manual") %}</a></li>
<li><a class="text-muted" href="https://erpnext.com/docs/user" target="_blank">{%= __("Read the ERPNext Manual") %}</a></li>
<li><a class="text-muted" href="https://discuss.erpnext.com" target="_blank">{%= __("Community Forum") %}</a></li>
</ul>

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_industry_types():

View File

@@ -6,7 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from .operations import install_fixtures as fixtures, company_setup, taxes_setup, sample_data
from .operations import install_fixtures as fixtures, company_setup, sample_data
def get_setup_stages(args=None):
if frappe.db.sql("select name from tabCompany"):
@@ -37,18 +37,13 @@ def get_setup_stages(args=None):
]
},
{
'status': _('Setting up company and taxes'),
'status': _('Setting up company'),
'fail_msg': _('Failed to setup company'),
'tasks': [
{
'fn': setup_company,
'args': args,
'fail_msg': _("Failed to setup company")
},
{
'fn': setup_taxes,
'args': args,
'fail_msg': _("Failed to setup taxes")
}
]
},
@@ -94,9 +89,6 @@ def stage_fixtures(args):
def setup_company(args):
fixtures.install_company(args)
def setup_taxes(args):
taxes_setup.create_sales_tax(args)
def setup_post_company_fixtures(args):
fixtures.install_post_company_fixtures(args)
@@ -132,7 +124,6 @@ def login_as_first_user(args):
def setup_complete(args=None):
stage_fixtures(args)
setup_company(args)
setup_taxes(args)
setup_post_company_fixtures(args)
setup_defaults(args)
stage_four(args)

View File

@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import json, os
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

View File

@@ -109,6 +109,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
cache.setex(key, value, 6 * 60 * 60)
return flt(value)
except:
frappe.log_error(title="Get Exchange Rate")
frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date))
return 0.0