From e4c434ab6ff1067e3e981972cb4de6c2768c1502 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Aug 2014 17:03:35 +0530 Subject: [PATCH 1/3] [fix] Leave Application Calendar --- .../hr/doctype/leave_application/leave_application.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 124e309c4c..3222a0c216 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -242,8 +242,13 @@ def is_lwp(leave_type): @frappe.whitelist() def get_events(start, end): events = [] - employee = frappe.db.get_default("employee", frappe.session.user) - company = frappe.db.get_default("company", frappe.session.user) + + employee = frappe.db.get_value("Employee", {"user_id": frappe.session.user}, ["name", "company"], + as_dict=True) + if not employee: + return events + + employee, company = employee.name, employee.company from frappe.widgets.reportview import build_match_conditions match_conditions = build_match_conditions("Leave Application") From 6ab831b3870e6a3808cbedacb0a038458b0fd123 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Aug 2014 19:04:19 +0530 Subject: [PATCH 2/3] Allow Default Warehouse for Item, even if not a Stock Item --- erpnext/stock/doctype/item/item.json | 4 ++-- erpnext/stock/doctype/packed_item/packed_item.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 88109bbf9c..45b423271a 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -175,7 +175,7 @@ "reqd": 1 }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "depends_on": "", "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.", "fieldname": "default_warehouse", "fieldtype": "Link", @@ -825,7 +825,7 @@ "icon": "icon-tag", "idx": 1, "max_attachments": 1, - "modified": "2014-07-03 10:45:19.574737", + "modified": "2014-08-18 09:32:57.268763", "modified_by": "Administrator", "module": "Stock", "name": "Item", diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index f04625b349..9263907da1 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -67,12 +67,10 @@ def make_packing_list(obj, item_table_fieldname): packing_list_idx = 0 parent_items = [] for d in obj.get(item_table_fieldname): - warehouse = (item_table_fieldname == "sales_order_details") \ - and d.warehouse or d.warehouse if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}): for i in get_sales_bom_items(d.item_code): update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty), - warehouse, d, packing_list_idx) + d.warehouse, d, packing_list_idx) if [d.item_code, d.name] not in parent_items: parent_items.append([d.item_code, d.name]) From f72de95a38a05e63fded93e302d14df16e310d33 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Aug 2014 19:51:47 +0530 Subject: [PATCH 3/3] [fix] SMS Center --- erpnext/selling/doctype/sms_center/sms_center.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 8c4cad3207..d53a20ec89 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -18,12 +18,10 @@ class SMSCenter(Document): where_clause = self.customer and " and customer = '%s'" % \ self.customer.replace("'", "\'") or " and ifnull(customer, '') != ''" if self.send_to == 'All Supplier Contact': - where_clause = self.supplier and \ - " and ifnull(is_supplier, 0) = 1 and supplier = '%s'" % \ + where_clause = self.supplier and " and supplier = '%s'" % \ self.supplier.replace("'", "\'") or " and ifnull(supplier, '') != ''" if self.send_to == 'All Sales Partner Contact': - where_clause = self.sales_partner and \ - " and ifnull(is_sales_partner, 0) = 1 and sales_partner = '%s'" % \ + where_clause = self.sales_partner and " and sales_partner = '%s'" % \ self.sales_partner.replace("'", "\'") or " and ifnull(sales_partner, '') != ''" if self.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']: