From 7621a94ed9e97a100199857c28988d0f90e6e742 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 15:24:34 +0530 Subject: [PATCH 01/12] allow leave application to have attachments --- .../leave_application/leave_application.txt | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index 1e1912873c..5942eaec8a 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -1,18 +1,20 @@ [ { - "creation": "2013-02-18 17:08:32", + "creation": "2013-02-18 18:37:56", "docstatus": 0, - "modified": "2013-02-18 17:20:50", + "modified": "2013-02-19 15:21:03", "modified_by": "Administrator", "owner": "Administrator" }, { + "allow_attach": 1, "allow_import": 1, "autoname": "LAP/.#####", "description": "Apply / Approve Leaves", "doctype": "DocType", "document_type": "Transaction", "is_submittable": 1, + "max_attachments": 3, "module": "HR", "name": "__common__", "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year" @@ -209,6 +211,16 @@ "print_hide": 1, "read_only": 1 }, + { + "doctype": "DocField", + "fieldname": "file_list", + "fieldtype": "Text", + "hidden": 1, + "label": "File List", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1 + }, { "create": 1, "doctype": "DocPerm", @@ -218,11 +230,21 @@ "role": "Employee", "write": 1 }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "doctype": "DocPerm", + "permlevel": 1, + "role": "All", + "submit": 0 + }, { "amend": 1, "cancel": 1, "create": 1, "doctype": "DocPerm", + "match": "company", "permlevel": 0, "report": 1, "role": "HR User", @@ -247,16 +269,7 @@ "create": 0, "doctype": "DocPerm", "permlevel": 1, - "role": "All", - "submit": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "permlevel": 1, - "report": 0, + "report": 1, "role": "HR User", "submit": 0, "write": 1 @@ -267,7 +280,7 @@ "create": 0, "doctype": "DocPerm", "permlevel": 1, - "report": 0, + "report": 1, "role": "Leave Approver", "submit": 0, "write": 1 From 39fc5179f962c0ff2a670495404d40bf7957d6cb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 19 Feb 2013 15:47:19 +0530 Subject: [PATCH 02/12] display customer name instead of customer id in quotation print format --- selling/Print Format/Quotation Classic/Quotation Classic.txt | 4 ++-- selling/Print Format/Quotation Modern/Quotation Modern.txt | 4 ++-- selling/Print Format/Quotation Spartan/Quotation Spartan.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/selling/Print Format/Quotation Classic/Quotation Classic.txt b/selling/Print Format/Quotation Classic/Quotation Classic.txt index 885570ecf2..ca950a21ad 100644 --- a/selling/Print Format/Quotation Classic/Quotation Classic.txt +++ b/selling/Print Format/Quotation Classic/Quotation Classic.txt @@ -2,14 +2,14 @@ { "creation": "2012-04-17 11:29:12", "docstatus": 0, - "modified": "2013-01-25 17:11:54", + "modified": "2013-02-19 15:44:56", "modified_by": "Administrator", "owner": "Administrator" }, { "doc_type": "Quotation", "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "module": "Selling", "name": "__common__", "standard": "Yes" diff --git a/selling/Print Format/Quotation Modern/Quotation Modern.txt b/selling/Print Format/Quotation Modern/Quotation Modern.txt index 707d5ead93..a323fbf829 100644 --- a/selling/Print Format/Quotation Modern/Quotation Modern.txt +++ b/selling/Print Format/Quotation Modern/Quotation Modern.txt @@ -2,14 +2,14 @@ { "creation": "2012-04-17 11:29:12", "docstatus": 0, - "modified": "2013-01-25 17:15:42", + "modified": "2013-02-19 15:44:22", "modified_by": "Administrator", "owner": "Administrator" }, { "doc_type": "Quotation", "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "module": "Selling", "name": "__common__", "standard": "Yes" diff --git a/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/selling/Print Format/Quotation Spartan/Quotation Spartan.txt index f49e4c9920..d2e04dda8d 100644 --- a/selling/Print Format/Quotation Spartan/Quotation Spartan.txt +++ b/selling/Print Format/Quotation Spartan/Quotation Spartan.txt @@ -2,14 +2,14 @@ { "creation": "2012-04-17 11:29:12", "docstatus": 0, - "modified": "2013-01-25 17:09:04", + "modified": "2013-02-19 15:45:22", "modified_by": "Administrator", "owner": "Administrator" }, { "doc_type": "Quotation", "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "module": "Selling", "name": "__common__", "standard": "Yes" From f2d68e2fd568ee85933da0cda71cbdbf2de39e0b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 19 Feb 2013 15:55:11 +0530 Subject: [PATCH 03/12] display customer name instead of customer id in quotation print format --- patches/patch_list.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/patches/patch_list.py b/patches/patch_list.py index d42360ef06..770eff0cf8 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -175,4 +175,7 @@ patch_list = [ "patches.february_2013.p05_leave_application", "patches.february_2013.gle_floating_point_issue_revisited", "patches.february_2013.fix_outstanding", + 'execute:webnotes.reload_doc([["selling", "Print Format", "Quotation Classic"], \ + ["selling", "Print Format", "Quotation Modern"], \ + ["selling", "Print Format", "Quotation Spartan"]]) # 2013-02-19', ] \ No newline at end of file From 0e5ea316cc696c0c6ab555b95cb4705a4707701d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 19 Feb 2013 16:14:27 +0530 Subject: [PATCH 04/12] fixes in naming series --- setup/doctype/naming_series/naming_series.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup/doctype/naming_series/naming_series.py b/setup/doctype/naming_series/naming_series.py index dbbc298c4c..599118152d 100644 --- a/setup/doctype/naming_series/naming_series.py +++ b/setup/doctype/naming_series/naming_series.py @@ -101,15 +101,19 @@ class DocType: from core.doctype.doctype.doctype import DocType dt = DocType() - parent = sql("select parent from `tabDocField` where fieldname='naming_series' and parent != %s", self.doc.select_doc_for_series) - sr = ([webnotes.model.doctype.get_property(p[0], 'options', 'naming_series'), p[0]] for p in parent) + parent = sql("""select dt.name from `tabDocField` df, `tabDocType` dt + where dt.name = df.parent and df.fieldname='naming_series' and dt.name != %s""", + self.doc.select_doc_for_series) + sr = ([webnotes.model.doctype.get_property(p[0], 'options', 'naming_series'), p[0]] + for p in parent) options = self.scrub_options_list(self.doc.set_options.split("\n")) for series in options: dt.validate_series(series, self.doc.select_doc_for_series) for i in sr: if i[0]: if series in i[0].split("\n"): - msgprint("Oops! Series name %s is already in use in %s. Please select a new one" % (series, i[1]), raise_exception=1) + msgprint("Oops! Series name %s is already in use in %s. \ + Please select a new one" % (series, i[1]), raise_exception=1) def validate_series_name(self, n): import re From 452de98a6cbd0929e71c3204dacc5d2de2f3814c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 19 Feb 2013 16:18:00 +0530 Subject: [PATCH 05/12] fixes in patch_list --- patches/patch_list.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/patch_list.py b/patches/patch_list.py index 770eff0cf8..538a0fd1ea 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -175,7 +175,7 @@ patch_list = [ "patches.february_2013.p05_leave_application", "patches.february_2013.gle_floating_point_issue_revisited", "patches.february_2013.fix_outstanding", - 'execute:webnotes.reload_doc([["selling", "Print Format", "Quotation Classic"], \ - ["selling", "Print Format", "Quotation Modern"], \ - ["selling", "Print Format", "Quotation Spartan"]]) # 2013-02-19', + 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Classic") # 2013-02-19', + 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Modern") # 2013-02-19', + 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Spartan") # 2013-02-19', ] \ No newline at end of file From 704d5f0f4ac61982480371be96034bcab256d2de Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 19 Feb 2013 16:23:21 +0530 Subject: [PATCH 06/12] delete service order/quotation doctype --- patches/patch_list.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patches/patch_list.py b/patches/patch_list.py index 538a0fd1ea..ab9130ebe6 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -178,4 +178,8 @@ patch_list = [ 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Classic") # 2013-02-19', 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Modern") # 2013-02-19', 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Spartan") # 2013-02-19', + "execute:webnotes.delete_doc('DocType', 'Service Order')", + "execute:webnotes.delete_doc('DocType', 'Service Quotation')", + "execute:webnotes.delete_doc('DocType', 'Service Order Detail')", + "execute:webnotes.delete_doc('DocType', 'Service Quotation Detail')", ] \ No newline at end of file From b05b1dacd5701df59d942418f9f314863d118474 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 16:54:49 +0530 Subject: [PATCH 07/12] added Follow Via Email --- .../leave_application/leave_application.py | 2 +- .../leave_application/leave_application.txt | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index 5170e26c25..981bb98d1c 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -185,7 +185,7 @@ class DocType(DocListController): args = webnotes._dict(args) from utilities.page.messages.messages import post post({"txt": args.message, "contact": args.message_to, "subject": args.subject, - "notify": True}) + "notify": cint(self.doc.follow_via_email)}) @webnotes.whitelist() def get_leave_balance(employee, leave_type, fiscal_year): diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index 5942eaec8a..f0f15604e6 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-18 18:37:56", "docstatus": 0, - "modified": "2013-02-19 15:21:03", + "modified": "2013-02-19 16:30:05", "modified_by": "Administrator", "owner": "Administrator" }, @@ -159,6 +159,16 @@ "label": "More Info", "permlevel": 0 }, + { + "allow_on_submit": 1, + "default": "1", + "doctype": "DocField", + "fieldname": "follow_via_email", + "fieldtype": "Check", + "label": "Follow via Email", + "permlevel": 0, + "print_hide": 1 + }, { "default": "Today", "doctype": "DocField", @@ -181,6 +191,12 @@ "reqd": 1, "search_index": 0 }, + { + "doctype": "DocField", + "fieldname": "column_break_17", + "fieldtype": "Column Break", + "permlevel": 0 + }, { "doctype": "DocField", "fieldname": "company", From d70f7dec2bffe803ae6445fbe1cfddb86de69dba Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 18:37:51 +0530 Subject: [PATCH 08/12] raise leave blocked error when status is saved as Approved --- hr/doctype/leave_application/leave_application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index 981bb98d1c..07086dcc4d 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -71,7 +71,7 @@ class DocType(DocListController): for d in block_dates: webnotes.msgprint(formatdate(d.block_date) + ": " + d.reason) - if self.doc.docstatus == 1: + if self.doc.status == "Approved": raise LeaveDayBlockedError def get_holidays(self): From f36a00bcbed438b9cf57381d86da088c02260698 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 18:43:20 +0530 Subject: [PATCH 09/12] changed description of allow users in Leave Block List --- hr/doctype/leave_block_list/leave_block_list.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hr/doctype/leave_block_list/leave_block_list.txt b/hr/doctype/leave_block_list/leave_block_list.txt index b48416c3df..dec4819d07 100644 --- a/hr/doctype/leave_block_list/leave_block_list.txt +++ b/hr/doctype/leave_block_list/leave_block_list.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-02-08 15:13:29", + "creation": "2013-02-18 17:43:12", "docstatus": 0, - "modified": "2013-02-14 17:15:32", + "modified": "2013-02-19 18:42:35", "modified_by": "Administrator", "owner": "Administrator" }, @@ -83,7 +83,7 @@ "options": "Leave Block List Date" }, { - "description": "Allow the following users to make Leave Applications for block days.", + "description": "Allow the following users to approve Leave Applications for block days.", "doctype": "DocField", "fieldname": "allow_list", "fieldtype": "Section Break", From 64e47afec12c1c34a84d2384c75346efa226bb20 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 18:49:12 +0530 Subject: [PATCH 10/12] calculate total leave days on load --- hr/doctype/leave_application/leave_application.js | 1 + 1 file changed, 1 insertion(+) diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 9df348a17e..2f2e3dc6c1 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -34,6 +34,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.get_leave_balance(cur_frm.doc); } }); + cur_frm.cscript.calculate_total_days(doc, dt, dn); } cur_frm.cscript.refresh = function(doc, dt, dn) { From 150d98d786ff09c8e5b0fec802858d5e2ebfa34b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 19 Feb 2013 18:52:20 +0530 Subject: [PATCH 11/12] calculate total leave days on load --- hr/doctype/leave_application/leave_application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 2f2e3dc6c1..025281826c 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -21,7 +21,8 @@ cur_frm.cscript.onload = function(doc, dt, dn) { if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); if(doc.__islocal) { - cur_frm.set_value("status", "Open") + cur_frm.set_value("status", "Open"); + cur_frm.cscript.calculate_total_days(doc, dt, dn); } cur_frm.set_df_property("leave_approver", "options", ""); cur_frm.call({ @@ -34,7 +35,6 @@ cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.get_leave_balance(cur_frm.doc); } }); - cur_frm.cscript.calculate_total_days(doc, dt, dn); } cur_frm.cscript.refresh = function(doc, dt, dn) { From a43b29e4b1bbbbef6ac9d7a00c1a3aecbd38a632 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 20 Feb 2013 15:55:10 +0530 Subject: [PATCH 12/12] get label from doctype's doclist --- stock/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/utils.py b/stock/utils.py index 62c2a1794f..3ab26ced1e 100644 --- a/stock/utils.py +++ b/stock/utils.py @@ -30,7 +30,7 @@ def validate_end_of_life(item_code, end_of_life=None, verbose=1): "in Item master") % { "item_code": item_code, "date": formatdate(end_of_life), - "end_of_life_label": webnotes.get_label("Item", "end_of_life") + "end_of_life_label": webnotes.get_doctype("Item").get_label("end_of_life") } _msgprint(msg, verbose)