From 36fc1d06fb51cf3e60bb5ecfbaef7068920f84e2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 4 Nov 2011 10:41:12 +0530 Subject: [PATCH 01/16] appriasal copy fix --- erpnext/hr/doctype/appraisal/appraisal.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index b2683d82de..be9cefbf3a 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -1,13 +1,21 @@ cur_frm.add_fetch('employee', 'company', 'company'); cur_frm.cscript.onload = function(doc,cdt,cdn){ - if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); - if(doc.employee) cur_frm.cscript.employee(doc,cdt,cdn); - if(doc.amended_from && doc.__islocal) cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); + if(doc.employee) + cur_frm.cscript.employee(doc,cdt,cdn); + if(doc.amended_from && doc.__islocal) + cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); +} + +cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){ + if(doc.employee) + cur_frm.cscript.employee(doc,cdt,cdn); } cur_frm.cscript.refresh = function(doc,cdt,cdn){ - if(user == doc.kra_approver && doc.status == 'Submitted') unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); + if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); + if(user == doc.kra_approver && doc.status == 'Submitted') + unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); else hide_field(['Update', 'Declare Completed', 'Calculate Total Score']); if(!doc.docstatus) unhide_field('Fetch Template'); From ae0054759224c0f9e1295a521eb3e2fb3da03a19 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 4 Nov 2011 10:43:11 +0530 Subject: [PATCH 02/16] appriasal copy fix --- erpnext/hr/doctype/appraisal/appraisal.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index be9cefbf3a..d040c5353d 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -1,8 +1,8 @@ cur_frm.add_fetch('employee', 'company', 'company'); cur_frm.cscript.onload = function(doc,cdt,cdn){ - if(doc.employee) - cur_frm.cscript.employee(doc,cdt,cdn); + if(!doc.status) + set_multiple(cdt,cdn,{status:'Draft'}); if(doc.amended_from && doc.__islocal) cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); } @@ -13,7 +13,6 @@ cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){ } cur_frm.cscript.refresh = function(doc,cdt,cdn){ - if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(user == doc.kra_approver && doc.status == 'Submitted') unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); else hide_field(['Update', 'Declare Completed', 'Calculate Total Score']); From c67e0d85d3e2595c21295509cbc9b5e0ef8b15ad Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Nov 2011 10:48:51 +0530 Subject: [PATCH 03/16] Employemnt Type filter removed from salary manager --- .../doctype/salary_manager/salary_manager.py | 2 +- .../doctype/salary_manager/salary_manager.txt | 47 +++---------------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index 50710568e8..badd69bd8e 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -46,7 +46,7 @@ class DocType: self.check_mandatory() cond = '' - for f in ['company', 'branch', 'department', 'designation', 'grade', 'employment_type']: + for f in ['company', 'branch', 'department', 'designation', 'grade']: if self.doc.fields.get(f): cond += " and t1." + f + " = '" + self.doc.fields.get(f) + "'" diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.txt index 66a7282380..c1ca4c6038 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.txt +++ b/erpnext/hr/doctype/salary_manager/salary_manager.txt @@ -5,18 +5,19 @@ { 'creation': '2011-08-11 16:40:04', 'docstatus': 0, - 'modified': '2011-08-25 12:02:57', + 'modified': '2011-11-07 10:47:32', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1314179318', + '_last_update': '1314253977', 'allow_copy': 1, 'allow_email': 1, 'allow_print': 1, 'colour': 'White:FFF', + 'default_print_format': 'Standard', 'doctype': 'DocType', 'document_type': 'Other', 'issingle': 1, @@ -24,7 +25,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 1, - 'version': 29 + 'version': 30 }, # These values are common for all DocField @@ -59,21 +60,18 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 1, 'role': 'System Manager' }, # DocPerm { 'doctype': 'DocPerm', - 'idx': 2, 'role': 'HR User' }, # DocPerm { 'doctype': 'DocPerm', - 'idx': 3, 'role': 'HR Manager' }, @@ -82,7 +80,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 1, 'label': 'Document Description', 'options': '
You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here
' }, @@ -90,15 +87,13 @@ # DocField { 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 2 + 'fieldtype': 'Section Break' }, # DocField { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 3, 'width': '50%' }, @@ -107,7 +102,6 @@ 'doctype': 'DocField', 'fieldname': 'company', 'fieldtype': 'Select', - 'idx': 4, 'label': 'Company', 'options': 'link:Company', 'reqd': 1 @@ -118,7 +112,6 @@ 'doctype': 'DocField', 'fieldname': 'branch', 'fieldtype': 'Link', - 'idx': 5, 'label': 'Branch', 'options': 'Branch' }, @@ -128,7 +121,6 @@ 'doctype': 'DocField', 'fieldname': 'department', 'fieldtype': 'Link', - 'idx': 6, 'label': 'Department', 'options': 'Department' }, @@ -138,7 +130,6 @@ 'doctype': 'DocField', 'fieldname': 'designation', 'fieldtype': 'Link', - 'idx': 7, 'label': 'Designation', 'options': 'Designation' }, @@ -147,7 +138,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 8, 'width': '50%' }, @@ -156,28 +146,16 @@ 'doctype': 'DocField', 'fieldname': 'grade', 'fieldtype': 'Select', - 'idx': 9, 'label': 'Grade', 'options': 'link:Grade' }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'employment_type', - 'fieldtype': 'Select', - 'idx': 10, - 'label': 'Employment Type', - 'options': 'link:Employment Type' - }, - # DocField { 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldname': 'fiscal_year', 'fieldtype': 'Select', - 'idx': 11, 'label': 'Fiscal Year', 'options': 'link:Fiscal Year', 'reqd': 1 @@ -189,7 +167,6 @@ 'doctype': 'DocField', 'fieldname': 'month', 'fieldtype': 'Select', - 'idx': 12, 'label': 'Month', 'options': '\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12', 'reqd': 1 @@ -202,22 +179,19 @@ 'doctype': 'DocField', 'fieldname': 'send_email', 'fieldtype': 'Check', - 'idx': 13, 'label': 'Send Email' }, # DocField { 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 14 + 'fieldtype': 'Section Break' }, # DocField { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 15, 'width': '50%' }, @@ -227,7 +201,6 @@ 'description': 'Creates salary slip for above mentioned criteria.', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 16, 'label': 'Create Salary Slip', 'trigger': 'Client' }, @@ -236,7 +209,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 17, 'width': '25%' }, @@ -246,7 +218,6 @@ 'description': 'Submit all salary slips for the above selected criteria', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 18, 'label': 'Submit Salary Slip', 'trigger': 'Client' }, @@ -255,7 +226,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 19, 'width': '25%' }, @@ -265,7 +235,6 @@ 'description': 'Create Bank Voucher for the total salary paid for the above selected criteria', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 20, 'label': 'Make Bank Voucher', 'trigger': 'Client' }, @@ -273,15 +242,13 @@ # DocField { 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 21 + 'fieldtype': 'Section Break' }, # DocField { 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 22, 'label': 'Activity Log' } ] \ No newline at end of file From 990a5eaccab495ea477d964bf58d759dead6ec71 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Nov 2011 10:51:29 +0530 Subject: [PATCH 04/16] sal manager reload patch --- erpnext/patches/sal_man_patch.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 erpnext/patches/sal_man_patch.py diff --git a/erpnext/patches/sal_man_patch.py b/erpnext/patches/sal_man_patch.py new file mode 100644 index 0000000000..1154f987ff --- /dev/null +++ b/erpnext/patches/sal_man_patch.py @@ -0,0 +1,5 @@ + +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + reload_doc('hr', 'doctype', 'salary_manager') From 30d34c431190510edcb8553d678c64f1bf40704b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Nov 2011 11:07:50 +0530 Subject: [PATCH 05/16] sal manager reload patch --- erpnext/patches/sal_man_patch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/patches/sal_man_patch.py b/erpnext/patches/sal_man_patch.py index 1154f987ff..aef625154b 100644 --- a/erpnext/patches/sal_man_patch.py +++ b/erpnext/patches/sal_man_patch.py @@ -2,4 +2,7 @@ def execute(): import webnotes from webnotes.modules.module_manager import reload_doc + sql = webnotes.conn.sql + reload_doc('hr', 'doctype', 'salary_manager') + sql("delete from `tabDocField` where parent = 'Salary Manager' and fieldname = 'employment_type'") From cc02fd445ce8978818414f19e674e7c45987e91b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Nov 2011 12:14:28 +0530 Subject: [PATCH 06/16] Repair button only visible after submit --- .../doctype/receivable_voucher/receivable_voucher.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js index 4478c5cafe..bb19681b98 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js @@ -74,6 +74,9 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { // ------- cur_frm.cscript.refresh = function(doc, dt, dn) { + cur_frm.cscript.is_opening(doc, dt, dn); + cur_frm.cscript.hide_fields(doc, cdt, cdn); + // Show / Hide button cur_frm.clear_custom_buttons(); @@ -90,8 +93,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } else hide_field('Repair Outstanding Amt'); - cur_frm.cscript.is_opening(doc, dt, dn); - cur_frm.cscript.hide_fields(doc, cdt, cdn); } //fetch retail transaction related fields From efd222b6ac90551ddfaf314041112045a0f27dc7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 8 Nov 2011 10:39:52 +0530 Subject: [PATCH 07/16] logout fix --- erpnext/home/doctype/home_control/home_control.py | 4 ++-- erpnext/startup/startup.js | 15 ++++++++------- index.html | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/erpnext/home/doctype/home_control/home_control.py b/erpnext/home/doctype/home_control/home_control.py index 8242e74431..ce15bfd57a 100644 --- a/erpnext/home/doctype/home_control/home_control.py +++ b/erpnext/home/doctype/home_control/home_control.py @@ -31,6 +31,8 @@ class DocType: def get_modules(self): rl = webnotes.user.get_roles() ml = sql("select distinct t1.name, t1.module_icon, t1.module_label, t1.module_desc, t1.module_page from `tabModule Def` t1, `tabModule Def Role` t2 where t2.role in ('%s') and t1.disabled !='Yes' and ifnull(t1.is_hidden, 'No') != 'Yes' and t1.name = t2.parent order by t1.module_seq asc" % "','".join(rl), as_dict=1) + webnotes.response['login_url'] = session['data'].get('login_from', '') + return ml def get_module_details(self,m): @@ -48,8 +50,6 @@ class DocType: AND t2.role IN ("%s") AND ifnull(standard,"No")="No"''' % (m, '", "'.join(webnotes.user.get_roles())), as_dict=1) - ret['login_url'] = session['data'].get('login_from', '') - return ret # ---------------------------------------------------------------------------------------------------------------- diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 3e2fde404e..fcb097bd4e 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -56,6 +56,14 @@ pscript.startup_make_sidebar = function() { // menu var ml = r.message; + // login-file + if(r.login_url){ + login_file = 'http://' + r.login_url; + } + else if(pscript.is_erpnext_saas) { + login_file = 'https://www.erpnext.com'; + } + // clear page_body.left_sidebar.innerHTML = ''; @@ -292,13 +300,6 @@ SidebarItem.prototype.show_items = function() { } } - if(r.login_url){ - login_file = 'http://' + r.login_url; - } - else if(pscript.is_erpnext_saas) { - login_file = 'https://www.erpnext.com'; - } - $(me.items_area).slideDown(); diff --git a/index.html b/index.html index f4f087ba6b..315fe8ab4c 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -