mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
Merge branch 'develop' into yet-another-desk
This commit is contained in:
@@ -424,8 +424,13 @@ def install_country_fixtures(company):
|
||||
company_doc = frappe.get_doc("Company", company)
|
||||
path = frappe.get_app_path('erpnext', 'regional', frappe.scrub(company_doc.country))
|
||||
if os.path.exists(path.encode("utf-8")):
|
||||
frappe.get_attr("erpnext.regional.{0}.setup.setup"
|
||||
.format(frappe.scrub(company_doc.country)))(company_doc, False)
|
||||
try:
|
||||
module_name = "erpnext.regional.{0}.setup.setup".format(frappe.scrub(company_doc.country))
|
||||
frappe.get_attr(module_name)(company_doc, False)
|
||||
except Exception as e:
|
||||
frappe.log_error(str(e), frappe.get_traceback())
|
||||
frappe.throw(_("Failed to setup defaults for country {0}. Please contact support@erpnext.com").format(frappe.bold(company_doc.country)))
|
||||
|
||||
|
||||
def update_company_current_month_sales(company):
|
||||
current_month_year = formatdate(today(), "MM-yyyy")
|
||||
|
||||
@@ -108,8 +108,8 @@ def delete_lead_addresses(company_name):
|
||||
def delete_communications(doctype, company_name, company_fieldname):
|
||||
reference_docs = frappe.get_all(doctype, filters={company_fieldname:company_name})
|
||||
reference_doc_names = [r.name for r in reference_docs]
|
||||
|
||||
|
||||
communications = frappe.get_all("Communication", filters={"reference_doctype":doctype,"reference_name":["in", reference_doc_names]})
|
||||
communication_names = [c.name for c in communications]
|
||||
|
||||
frappe.delete_doc("Communication", communication_names)
|
||||
frappe.delete_doc("Communication", communication_names, ignore_permissions=True)
|
||||
|
||||
@@ -19,6 +19,11 @@ frappe.ui.form.on('Sales Person', {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
frm.make_methods = {
|
||||
'Sales Order': () => frappe.new_doc("Sales Order")
|
||||
.then(() => frm.add_child("sales_team", {"sales_person": frm.doc.name}))
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user