Merge pull request #2073 from anandpdoshi/anand-august-18
[fix] Leave Application Calendar - Fixes #2065
This commit is contained in:
commit
5e893ef8fd
@ -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")
|
||||
|
@ -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']:
|
||||
|
@ -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",
|
||||
|
@ -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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user