Merge pull request #3670 from neilLasrado/expense-claim
Default Expense Account added to Expense Claim Type.
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index ef61354..67cff5d 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '5.1.6'
+__version__ = '5.2.0'
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 3ea92e1..1ecde64 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -109,7 +109,7 @@
against_jv: function(doc, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
- if (d.against_jv && d.party && !flt(d.credit) && !flt(d.debit)) {
+ if (d.against_jv && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding('Journal Entry', d.against_jv, d);
}
},
@@ -119,7 +119,8 @@
var args = {
"doctype": doctype,
"docname": docname,
- "party": child.party
+ "party": child.party,
+ "account": child.account
}
return this.frm.call({
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 23d4c73..dc620ed 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -545,12 +545,14 @@
@frappe.whitelist()
def get_outstanding(args):
args = eval(args)
- if args.get("doctype") == "Journal Entry" and args.get("party"):
+ if args.get("doctype") == "Journal Entry":
+ condition = " and party=%(party)s" if args.get("party") else ""
+
against_jv_amount = frappe.db.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
- from `tabJournal Entry Account` where parent=%s and party=%s
+ from `tabJournal Entry Account` where parent=%(docname)s and account=%(account)s {0}
and ifnull(against_invoice, '')='' and ifnull(against_voucher, '')=''
- and ifnull(against_jv, '')=''""", (args['docname'], args['party']))
+ and ifnull(against_jv, '')=''""".format(condition), args)
against_jv_amount = flt(against_jv_amount[0][0]) if against_jv_amount else 0
if against_jv_amount > 0:
diff --git a/erpnext/change_log/current/learn.md b/erpnext/change_log/current/learn.md
deleted file mode 100644
index f91c0a4..0000000
--- a/erpnext/change_log/current/learn.md
+++ /dev/null
@@ -1 +0,0 @@
-- New help videos for Selling, Buying, Human Resource, Manufacturing and Buying
diff --git a/erpnext/change_log/current/paranthesis_in_images.md b/erpnext/change_log/current/paranthesis_in_images.md
deleted file mode 100644
index 4859e96..0000000
--- a/erpnext/change_log/current/paranthesis_in_images.md
+++ /dev/null
@@ -1 +0,0 @@
-- Display images in website's Item and Item List pages when the filename has paranthesis in its name
diff --git a/erpnext/change_log/current/rename.md b/erpnext/change_log/current/rename.md
deleted file mode 100644
index 54efb50..0000000
--- a/erpnext/change_log/current/rename.md
+++ /dev/null
@@ -1,3 +0,0 @@
-- Role rename: **Material User** is now **Stock User**
-- Role rename: **Material Manager** is now **Stock Manager**
-- Role rename: **Material Master Manager** is now **Item Manager**
diff --git a/erpnext/change_log/current/shopping_cart.md b/erpnext/change_log/current/shopping_cart.md
deleted file mode 100644
index 77a5e5d..0000000
--- a/erpnext/change_log/current/shopping_cart.md
+++ /dev/null
@@ -1,3 +0,0 @@
-- Fixed inconsistent visibility of 'Add to Cart' button
-- Use Customer's Price List in Shopping Cart if found
-- Fixed Address creation from Shopping Cart
diff --git a/erpnext/change_log/v5/v5_2_0.md b/erpnext/change_log/v5/v5_2_0.md
new file mode 100644
index 0000000..5884595
--- /dev/null
+++ b/erpnext/change_log/v5/v5_2_0.md
@@ -0,0 +1,9 @@
+- New help videos for Selling, Buying, Human Resource, Manufacturing and Buying
+- Role rename: **Material User** is now **Stock User**
+- Role rename: **Material Manager** is now **Stock Manager**
+- Role rename: **Material Master Manager** is now **Item Manager**
+- Fixed inconsistent visibility of 'Add to Cart' button
+- Use Customer's Price List in Shopping Cart
+- Fixed Address creation from Shopping Cart
+- Display images in website's Item and Item List pages when the filename has paranthesis in its name
+
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index b0c7345..498d100 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -64,7 +64,7 @@
"type": "module"
},
"Learn": {
- "color": "#7272FF",
+ "color": "#FCB868",
"force_show": True,
"icon": "icon-facetime-video",
"type": "module",
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index c709326..b2a9f03 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -171,9 +171,6 @@
frappe.throw(_("Row {0}: Qty is mandatory").format(d.idx))
if self.doctype == "Sales Order":
- if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or
- self.has_product_bundle(d.item_code)) and not d.warehouse:
- frappe.throw(_("Reserved Warehouse required for stock Item {0} in row {1}").format(d.item_code, d.idx))
reserved_warehouse = d.warehouse
if flt(d.qty) > flt(d.delivered_qty):
reserved_qty_for_main_item = flt(d.qty) - flt(d.delivered_qty)
diff --git a/erpnext/crm/doctype/newsletter_list/newsletter_list.json b/erpnext/crm/doctype/newsletter_list/newsletter_list.json
index 3fa7f65..e5e5c15 100644
--- a/erpnext/crm/doctype/newsletter_list/newsletter_list.json
+++ b/erpnext/crm/doctype/newsletter_list/newsletter_list.json
@@ -32,6 +32,7 @@
"default": "0",
"fieldname": "total_subscribers",
"fieldtype": "Int",
+ "in_list_view": 1,
"label": "Total Subscribers",
"permlevel": 0,
"precision": "",
@@ -45,7 +46,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-03-18 08:08:37.692367",
+ "modified": "2015-07-15 07:18:30.094155",
"modified_by": "Administrator",
"module": "CRM",
"name": "Newsletter List",
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 30032f8..3418b9f 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -5,7 +5,7 @@
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "5.1.6"
+app_version = "5.2.0"
error_report_email = "support@erpnext.com"
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index f550a8a..fe67ed8 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -181,15 +181,12 @@
if item.default_bom != self.name:
item.default_bom = self.name
item.save()
-
else:
- if not self.is_active:
- frappe.db.set(self, "is_default", 0)
-
- item = frappe.get_doc("Item", self.item)
- if item.default_bom == self.name:
- item.default_bom = None
- item.save()
+ frappe.db.set(self, "is_default", 0)
+ item = frappe.get_doc("Item", self.item)
+ if item.default_bom == self.name:
+ item.default_bom = None
+ item.save()
def clear_operations(self):
if not self.with_operations:
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f5ae5b7..269dcba 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -100,6 +100,7 @@
execute:frappe.reload_doc('crm', 'doctype', 'lead')
execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
erpnext.patches.v5_0.rename_taxes_and_charges_master
+erpnext.patches.v5_1.sales_bom_rename
erpnext.patches.v5_0.rename_table_fieldnames
execute:frappe.db.sql("update `tabJournal Entry` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
erpnext.patches.v5_0.is_group
@@ -173,6 +174,6 @@
erpnext.patches.v5_1.fix_against_account
erpnext.patches.v5_1.fix_credit_days_based_on
erpnext.patches.v5_1.track_operations
-erpnext.patches.v5_1.sales_bom_rename
execute:frappe.rename_doc("DocType", "Salary Manager", "Process Payroll", force=True)
erpnext.patches.v5_1.rename_roles
+erpnext.patches.v5_1.default_bom
diff --git a/erpnext/patches/v4_0/fields_to_be_renamed.py b/erpnext/patches/v4_0/fields_to_be_renamed.py
index 2baab97..cc17697 100644
--- a/erpnext/patches/v4_0/fields_to_be_renamed.py
+++ b/erpnext/patches/v4_0/fields_to_be_renamed.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.model import rename_field
+from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
rename_map = {
diff --git a/erpnext/patches/v5_0/rename_table_fieldnames.py b/erpnext/patches/v5_0/rename_table_fieldnames.py
index 758280f..05d5c91 100644
--- a/erpnext/patches/v5_0/rename_table_fieldnames.py
+++ b/erpnext/patches/v5_0/rename_table_fieldnames.py
@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
-from frappe.model import rename_field
+from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
rename_map = {
@@ -111,7 +111,6 @@
["installed_item_details", "items"]
],
"Item": [
- ["item_variants", "variants"],
["item_reorder", "reorder_levels"],
["uom_conversion_details", "uoms"],
["item_supplier_details", "supplier_items"],
@@ -168,7 +167,7 @@
["earning_details", "earnings"],
["deduction_details", "deductions"]
],
- "Sales BOM": [
+ "Product Bundle": [
["sales_bom_items", "items"]
],
"SMS Settings": [
diff --git a/erpnext/patches/v5_0/rename_total_fields.py b/erpnext/patches/v5_0/rename_total_fields.py
index cf95caa..6657dd8 100644
--- a/erpnext/patches/v5_0/rename_total_fields.py
+++ b/erpnext/patches/v5_0/rename_total_fields.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.model import rename_field
+from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
selling_doctypes = ("Quotation", "Sales Order", "Delivery Note", "Sales Invoice")
diff --git a/erpnext/patches/v5_1/default_bom.py b/erpnext/patches/v5_1/default_bom.py
new file mode 100644
index 0000000..6484edd
--- /dev/null
+++ b/erpnext/patches/v5_1/default_bom.py
@@ -0,0 +1,7 @@
+from __future__ import unicode_literals
+
+import frappe
+
+def execute():
+ frappe.db.sql("""Update `tabItem` as item set default_bom = NULL where
+ not exists(select name from `tabBOM` as bom where item.default_bom = bom.name and bom.docstatus =1 )""")
\ No newline at end of file
diff --git a/erpnext/patches/v5_1/rename_roles.py b/erpnext/patches/v5_1/rename_roles.py
index 0ea2e13..452c800 100644
--- a/erpnext/patches/v5_1/rename_roles.py
+++ b/erpnext/patches/v5_1/rename_roles.py
@@ -1,9 +1,9 @@
import frappe
def execute():
- frappe.rename_doc("Role", "Material User", "Stock User",
- merge=frappe.db.exists("Role", "Stock User"))
- frappe.rename_doc("Role", "Material Manager", "Stock Manager",
- merge=frappe.db.exists("Role", "Stock User"))
- frappe.rename_doc("Role", "Material Master Manager", "Item Manager",
- merge=frappe.db.exists("Role", "Stock User"))
+ if not frappe.db.exists("Role", "Stock User"):
+ frappe.rename_doc("Role", "Material User", "Stock User")
+ if not frappe.db.exists("Role", "Stock Manager"):
+ frappe.rename_doc("Role", "Material Manager", "Stock Manager")
+ if not frappe.db.exists("Role", "Stock Manager"):
+ frappe.rename_doc("Role", "Material Master Manager", "Item Manager")
diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js
index d9a611e..4e870fa 100644
--- a/erpnext/projects/doctype/task/task.js
+++ b/erpnext/projects/doctype/task/task.js
@@ -5,42 +5,59 @@
cur_frm.add_fetch("project", "company", "company");
-erpnext.projects.Task = frappe.ui.form.Controller.extend({
- setup: function() {
- this.frm.fields_dict.project.get_query = function() {
+frappe.ui.form.on("Task", {
+ refresh: function(frm) {
+ var doc = frm.doc;
+ if(!doc.__islocal) {
+ if(frappe.model.can_read("Time Log")) {
+ frm.add_custom_button(__("Time Logs"), function() {
+ frappe.route_options = {"project": doc.project, "task": doc.name}
+ frappe.set_route("List", "Time Log");
+ }, "icon-list", true);
+ }
+ if(frappe.model.can_read("Expense Claim")) {
+ frm.add_custom_button(__("Expense Claims"), function() {
+ frappe.route_options = {"project": doc.project, "task": doc.name}
+ frappe.set_route("List", "Expense Claim");
+ }, "icon-list", true);
+ }
+
+ if(frm.perm[0].write) {
+ if(frm.doc.status==="Open") {
+ frm.add_custom_button("Close", function() {
+ frm.set_value("status", "Closed");
+ frm.save();
+ });
+ } else {
+ frm.add_custom_button("Reopen", function() {
+ frm.set_value("status", "Open");
+ frm.save();
+ });
+ }
+ }
+ }
+ },
+
+ setup: function(frm) {
+ frm.fields_dict.project.get_query = function() {
return {
query: "erpnext.projects.doctype.task.task.get_project"
}
};
},
- project: function() {
- if(this.frm.doc.project) {
- return get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
- this.frm.doc.name, 1);
+ project: function(frm) {
+ if(frm.doc.project) {
+ return get_server_fields('get_project_details', '','', frm.doc, frm.doc.doctype,
+ frm.doc.name, 1);
}
},
- validate: function() {
- this.frm.doc.project && frappe.model.remove_from_locals("Project",
- this.frm.doc.project);
+ validate: function(frm) {
+ frm.doc.project && frappe.model.remove_from_locals("Project",
+ frm.doc.project);
},
-
- refresh: function(doc) {
- if(!doc.__islocal) {
- cur_frm.add_custom_button(__("Time Logs"), function() {
- frappe.route_options = {"project": doc.project, "task": doc.name}
- frappe.set_route("List", "Time Log");
- }, "icon-list", true);
- cur_frm.add_custom_button(__("Expense Claims"), function() {
- frappe.route_options = {"project": doc.project, "task": doc.name}
- frappe.set_route("List", "Expense Claim");
- }, "icon-list", true);
- }
- }
+
});
cur_frm.add_fetch('task', 'subject', 'subject');
-
-cur_frm.cscript = new erpnext.projects.Task({frm: cur_frm});
-
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index b5f2a2d..3c286b1 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -96,3 +96,8 @@
.pos .tax-table {
margin-bottom: 10px;
}
+.erpnext-icon {
+ width: 24px;
+ margin-right: 0px;
+ margin-top: -3px;
+}
diff --git a/erpnext/public/images/erp-icon.svg b/erpnext/public/images/erp-icon.svg
new file mode 100644
index 0000000..b4e2a24
--- /dev/null
+++ b/erpnext/public/images/erp-icon.svg
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
+<g>
+ <path fill="#7574FF" d="M512,448c0,35.2-28.8,64-64,64H64c-35.2,0-64-28.8-64-64V64C0,28.8,28.8,0,64,0h384c35.2,0,64,28.8,64,64
+ V448z"/>
+</g>
+<g>
+ <path fill="#FFFFFF" d="M150.483,371.684V141.15c0-15.167,9.534-25.133,23.833-25.133h162.5c13.866,0,20.8,6.933,20.8,18.633v2.6
+ c0,12.133-6.934,18.633-20.8,18.633h-141.7v78.434h109.634c14.3,0,20.8,6.066,20.8,17.767v1.3c0,12.133-6.934,18.633-20.8,18.633
+ H195.117v84.934h144.3c13.867,0,20.367,6.066,20.367,17.767v2.167c0,12.566-6.5,19.5-20.367,19.5h-165.1
+ C160.017,396.384,150.483,386.851,150.483,371.684z"/>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index 6264019..af06b33 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -11,7 +11,7 @@
href="https://discuss.erpnext.com">Feedback</a></p>'
- $('.navbar-home').html('ERPNext');
+ $('.navbar-home').html('<img class="erpnext-icon" src="/assets/erpnext/images/erp-icon.svg" />');
$('[data-link="docs"]').attr("href", "https://manual.erpnext.com")
});
diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less
index 830902a..3f839ee 100644
--- a/erpnext/public/less/erpnext.less
+++ b/erpnext/public/less/erpnext.less
@@ -120,3 +120,8 @@
margin-bottom: 10px;
}
+.erpnext-icon {
+ width: 24px;
+ margin-right: 0px;
+ margin-top: -3px;
+}
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 7f0b386..fcdae4d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -46,7 +46,6 @@
} else {
// un-stop
- cur_frm.dashboard.set_headline_alert(__("Stopped"), "alert-danger", "icon-stop");
cur_frm.add_custom_button(__('Unstop'), cur_frm.cscript['Unstop Sales Order'], "icon-check");
}
}
diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py
index a9201e7..1403ee5 100644
--- a/erpnext/setup/doctype/sms_settings/sms_settings.py
+++ b/erpnext/setup/doctype/sms_settings/sms_settings.py
@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
-import frappe, json
+import frappe
from frappe import _, throw, msgprint
from frappe.utils import cstr, nowdate
@@ -92,6 +92,8 @@
conn.request('GET', api_url + urllib.urlencode(args), headers = headers) # send request
resp = conn.getresponse() # get response
resp = resp.read()
+ if resp.status==200:
+ create_sms_log()
return resp
# Split gateway url to server and api url
diff --git a/erpnext/setup/page/setup_wizard/emails/email-1.md b/erpnext/setup/page/setup_wizard/emails/email-1.md
deleted file mode 100644
index 70c0c73..0000000
--- a/erpnext/setup/page/setup_wizard/emails/email-1.md
+++ /dev/null
@@ -1,27 +0,0 @@
-Dear {{ fullname }},
-
-Thanks for setting up your ERPNext account!
-
-ERPNext is an open source and cloud ERP system that will help you to:
-
-1. Become organized by having a central repository of your data.
-1. Stay on top of what is happening in the organization.
-1. Prioritize and act quickly on pending activities.
-1. Analyze your performance and find improvement areas.
-1. Profit!
-
-Some tips on setting up ERPNext:
-
-1. Try and make dummy cycles: Run your dummy quotes, invoices, payments, deliveries in the system so that you can get familiar with what ERPNext can do for you.
-1. Data Import Tool: You can import bulk data into system using the data import tool: via **Setup > Data > Data Import Tool**.
-1. Add more users via **Setup > Users and Permissions > User**.
-1. If you are done with the testing and want to start fresh, you can delete your company and create a new one.
-
-If you need help or are stuck, [head to the user forum](https://discuss.frappe.io) or [read the manual](https://manual.erpnext.com).
-
-[Watch the ERPNext help tutorial videos](https://www.youtube.com/playlist?list=PL3lFfCEoMxvxDHtYyQFJeUYkWzQpXwFM9)
-
-
-Best of luck!
-
-Automatically Sent from your ERPNext Account
diff --git a/erpnext/setup/page/setup_wizard/emails/email-2.md b/erpnext/setup/page/setup_wizard/emails/email-2.md
deleted file mode 100644
index 3d7ad82..0000000
--- a/erpnext/setup/page/setup_wizard/emails/email-2.md
+++ /dev/null
@@ -1,14 +0,0 @@
-Dear {{ fullname }},
-
-If you need help in setting up your ERPNext account, here are some resources:
-
-1. [Read the manual](https://manual.erpnext.com)
-1. [See the help videos](https://www.youtube.com/playlist?list=PL3lFfCEoMxvxDHtYyQFJeUYkWzQpXwFM9)
-1. [Ask your questions in the user forum](https://discuss.frappe.io)
-1. [Buy support from the ERPNext Team](https://erpnext.com/pricing)
-1. [Connect with a Service Provider](https://community.erpnext.com/service-providers)
-1. [Hangout on the community chat (gitter.im)](https://gitter.im/frappe/erpnext)
-
-Thanks!
-
-Automatically sent from your ERPNext Account
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index a9774fa..4bb01d4 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -13,7 +13,6 @@
from frappe.utils.nestedset import get_root_of
from .default_website import website_maker
import install_fixtures
-from .welcome_emails import setup_welcome_emails
@frappe.whitelist()
def setup_account(args=None):
@@ -78,8 +77,6 @@
login_as_first_user(args)
- setup_welcome_emails()
-
frappe.db.commit()
frappe.clear_cache()
diff --git a/erpnext/setup/page/setup_wizard/welcome_emails.py b/erpnext/setup/page/setup_wizard/welcome_emails.py
deleted file mode 100644
index 03a9717..0000000
--- a/erpnext/setup/page/setup_wizard/welcome_emails.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.utils import add_days, nowdate, get_fullname
-import markdown2
-
-def setup_welcome_emails():
- for email in (
- {"fname": "email-1.md", "subject": "Setting up ERPNext", "after": 1},
- {"fname": "email-2.md", "subject": "Getting ERPNext Help", "after": 3},
- ):
- content = frappe.get_template("setup/page/setup_wizard/emails/" \
- + email["fname"]).render({"fullname": get_fullname()})
-
- frappe.sendmail(recipients = frappe.session.user, subject = email["subject"],
- sender = "hello@erpnext.com",
- content=markdown2.markdown(content), as_bulk = True,
- send_after= add_days(nowdate(), email["after"]))
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index ff027d7..010f5ea 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -57,7 +57,12 @@
def validate_item(self):
item_det = frappe.db.sql("""select name, has_batch_no, docstatus,
is_stock_item, has_variants, stock_uom
- from tabItem where name=%s""", self.item_code, as_dict=True)[0]
+ from tabItem where name=%s""", self.item_code, as_dict=True)
+
+ if not item_det:
+ frappe.throw(_("Item {0} not found").format(self.item_code))
+
+ item_det = item_det[0]
if item_det.is_stock_item != 'Yes':
frappe.throw(_("Item {0} must be a stock Item").format(self.item_code))
@@ -97,7 +102,7 @@
def scrub_posting_time(self):
if not self.posting_time or self.posting_time == '00:0':
self.posting_time = '00:00'
-
+
def validate_batch(self):
if self.batch_no and self.voucher_type != "Stock Entry":
expiry_date = frappe.db.get_value("Batch", self.batch_no, "expiry_date")
diff --git a/setup.py b/setup.py
index e7702e4..610b284 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = "5.1.6"
+version = "5.2.0"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()