[minor] fixes
This commit is contained in:
parent
878dfec46a
commit
8c2e79cf0d
@ -88,8 +88,8 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
if not struct:
|
if not struct:
|
||||||
self.salary_structure = None
|
self.salary_structure = None
|
||||||
msgprint(_("No active or default Salary Structure found for employee {0} and the month")
|
frappe.throw(_("No active or default Salary Structure found for employee {0} for the given dates")
|
||||||
.format(self.employee))
|
.format(self.employee), title=_('Salary Structure Missing'))
|
||||||
|
|
||||||
return struct and struct[0][0] or ''
|
return struct and struct[0][0] or ''
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ class SalarySlip(TransactionBase):
|
|||||||
self.update_status(self.name)
|
self.update_status(self.name)
|
||||||
if(frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")):
|
if(frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")):
|
||||||
self.email_salary_slip()
|
self.email_salary_slip()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.update_status()
|
self.update_status()
|
||||||
|
|
||||||
|
@ -16,15 +16,7 @@ class Project(Document):
|
|||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load project tasks for quick view"""
|
"""Load project tasks for quick view"""
|
||||||
if not self.get('__unsaved') and not self.get("tasks"):
|
if not self.get('__unsaved') and not self.get("tasks"):
|
||||||
for task in self.get_tasks():
|
self.load_tasks()
|
||||||
self.append("tasks", {
|
|
||||||
"title": task.subject,
|
|
||||||
"status": task.status,
|
|
||||||
"start_date": task.exp_start_date,
|
|
||||||
"end_date": task.exp_end_date,
|
|
||||||
"description": task.description,
|
|
||||||
"task_id": task.name
|
|
||||||
})
|
|
||||||
|
|
||||||
self.set_onload('links', self.meta.get_links_setup())
|
self.set_onload('links', self.meta.get_links_setup())
|
||||||
self.set_onload('activity_summary', frappe.db.sql('''select activity_type, sum(hours) as total_hours
|
self.set_onload('activity_summary', frappe.db.sql('''select activity_type, sum(hours) as total_hours
|
||||||
@ -33,6 +25,19 @@ class Project(Document):
|
|||||||
def __setup__(self):
|
def __setup__(self):
|
||||||
self.onload()
|
self.onload()
|
||||||
|
|
||||||
|
def load_tasks(self):
|
||||||
|
"""Load `tasks` from the database"""
|
||||||
|
self.tasks = []
|
||||||
|
for task in self.get_tasks():
|
||||||
|
self.append("tasks", {
|
||||||
|
"title": task.subject,
|
||||||
|
"status": task.status,
|
||||||
|
"start_date": task.exp_start_date,
|
||||||
|
"end_date": task.exp_end_date,
|
||||||
|
"description": task.description,
|
||||||
|
"task_id": task.name
|
||||||
|
})
|
||||||
|
|
||||||
def get_tasks(self):
|
def get_tasks(self):
|
||||||
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
|
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ links = {
|
|||||||
'non_standard_fieldnames': {
|
'non_standard_fieldnames': {
|
||||||
'Production Order': 'production_item',
|
'Production Order': 'production_item',
|
||||||
'Product Bundle': 'new_item_code',
|
'Product Bundle': 'new_item_code',
|
||||||
|
'BOM': 'item',
|
||||||
'Batch': 'item'
|
'Batch': 'item'
|
||||||
},
|
},
|
||||||
'transactions': [
|
'transactions': [
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
{
|
{
|
||||||
"apply_user_permissions": 1,
|
"add_total_row": 0,
|
||||||
"creation": "2013-08-20 15:08:10",
|
"apply_user_permissions": 1,
|
||||||
"docstatus": 0,
|
"creation": "2013-08-20 15:08:10",
|
||||||
"doctype": "Report",
|
"disabled": 0,
|
||||||
"idx": 1,
|
"docstatus": 0,
|
||||||
"is_standard": "Yes",
|
"doctype": "Report",
|
||||||
"modified": "2014-06-03 07:18:17.128919",
|
"idx": 1,
|
||||||
"modified_by": "Administrator",
|
"is_standard": "Yes",
|
||||||
"module": "Stock",
|
"modified": "2016-06-29 17:39:54.122679",
|
||||||
"name": "Items To Be Requested",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator",
|
"module": "Stock",
|
||||||
|
"name": "Items To Be Requested",
|
||||||
|
"owner": "Administrator",
|
||||||
"query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
|
"query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
|
||||||
"ref_doctype": "Item",
|
"ref_doctype": "Material Request",
|
||||||
"report_name": "Items To Be Requested",
|
"report_name": "Items To Be Requested",
|
||||||
"report_type": "Query Report"
|
"report_type": "Query Report"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user