Merge branch 'develop' of https://github.com/frappe/erpnext.git into Item-Tax-Template-V12

# Conflicts:
#	erpnext/patches.txt
This commit is contained in:
Saif Ur Rehman
2019-02-01 19:17:04 +05:00
376 changed files with 6503 additions and 5071 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,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -523,7 +524,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-09-12 16:41:06.378899",
"modified": "2019-01-30 11:28:16.966735",
"modified_by": "Administrator",
"module": "Setup",
"name": "Sales Person",

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

@@ -263,10 +263,13 @@ def install(country=None):
def set_more_defaults():
# Do more setup stuff that can be done here with no dependencies
# set default customer group and territory
selling_settings = frappe.get_doc("Selling Settings")
selling_settings.set_default_customer_group_and_territory()
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.sales_update_frequency = "Each Transaction"
selling_settings.save()
add_uom_data()
@@ -276,14 +279,6 @@ def set_more_defaults():
doc.set_default_fields()
doc.save()
selling_settings = frappe.get_doc("Selling Settings")
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.sales_update_frequency = "Each Transaction"
selling_settings.save()
buying_settings = frappe.get_doc("Buying Settings")
buying_settings.supp_master_name = "Supplier Name"
buying_settings.po_required = "No"

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