Merge pull request #6819 from rohitwaghchaure/hotfix_issues

cleanup and fixes
This commit is contained in:
Nabin Hait 2016-11-08 12:05:47 +05:30 committed by GitHub
commit cdc895734f
6 changed files with 98 additions and 74 deletions

View File

@ -483,20 +483,22 @@ frappe.ui.form.on('Sales Invoice', {
frappe.ui.form.on('Sales Invoice Timesheet', {
time_sheet: function(frm, cdt, cdn){
var d = locals[cdt][cdn];
frappe.call({
method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_data",
args: {
'name': d.time_sheet,
'project': frm.doc.project || null
},
callback: function(r, rt) {
if(r.message){
data = r.message;
frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail);
if(d.time_sheet) {
frappe.call({
method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_data",
args: {
'name': d.time_sheet,
'project': frm.doc.project || null
},
callback: function(r, rt) {
if(r.message){
data = r.message;
frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail);
}
}
}
})
})
}
}
})

View File

@ -340,6 +340,8 @@ erpnext.patches.v7_0.update_status_of_zero_amount_sales_order
erpnext.patches.v7_1.add_field_for_task_dependent
erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
erpnext.patches.v7_1.set_prefered_contact_email
execute:frappe.db.sql("update `tabSingles` set value = 1 where field = 'unlink_payment_on_cancellation_of_invoice' and doctype = 'Accounts Settings'")
execute:frappe.reload_doc('accounts', 'doctype', 'accounts_settings')
execute:frappe.db.set_value("Accounts Settings", "Accounts Settings", "unlink_payment_on_cancellation_of_invoice", 0)
execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
erpnext.patches.v7_0.repost_gle_for_pi_with_update_stock #2016-11-01
erpnext.patches.v7_0.repost_gle_for_pi_with_update_stock #2016-11-01
erpnext.patches.v7_1.add_account_user_role_for_timesheet

View File

@ -0,0 +1,31 @@
# 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
def execute():
if not frappe.db.get_value('DocPerm', {'parent': 'Timesheet', 'role': 'Accounts User', 'permlevel': 1}):
doc = frappe.get_doc('DocType', 'Timesheet')
doc.append('permissions', {
'role': "Accounts User",
'permlevel': 0,
'read': 1,
'write': 1,
'create': 1,
'delete': 1,
'submit': 1,
'cancel': 1,
'amend': 1,
'report': 1,
'email': 1
})
doc.append('permissions', {
'role': "Accounts User",
'permlevel': 1,
'read': 1,
'write': 1
})
doc.save(ignore_permissions=True)

View File

@ -847,7 +847,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-03 16:06:32.259060",
"modified": "2016-11-04 18:27:08.484033",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet",
@ -916,48 +916,6 @@
"submit": 1,
"write": 1
},
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
@ -978,6 +936,48 @@
"share": 0,
"submit": 0,
"write": 1
},
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 0,
"submit": 1,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 1
}
],
"quick_entry": 0,

View File

@ -322,18 +322,7 @@ def make_sales_invoice(source_name, target=None):
@frappe.whitelist()
def make_salary_slip(source_name, target_doc=None):
target = frappe.new_doc("Salary Slip")
set_missing_values(source_name, target)
target.append("timesheets", get_mapped_doc("Timesheet", source_name, {
"Timesheet": {
"doctype": "Salary Slip Timesheet",
"field_map": {
"total_hours": "working_hours",
"name": "time_sheet"
},
}
}))
set_missing_values(source_name, target)
target.run_method("get_emp_and_leave_details")
return target

View File

@ -372,7 +372,7 @@
"in_list_view": 0,
"label": "Customer's Purchase Order",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"oldfieldname": "po_no",
"oldfieldtype": "Data",
"permlevel": 0,
@ -403,7 +403,7 @@
"in_list_view": 0,
"label": "Customer's Purchase Order Date",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"oldfieldname": "po_date",
"oldfieldtype": "Date",
"permlevel": 0,
@ -3226,7 +3226,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-03 16:07:46.757630",
"modified": "2016-11-05 08:09:08.921026",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",