Merge branch 'master' of github.com:webnotes/erpnext into edge

This commit is contained in:
Anand Doshi 2013-02-20 16:08:43 +05:30
commit 7ce7d7cad4
10 changed files with 70 additions and 29 deletions

View File

@ -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({

View File

@ -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):
@ -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):

View File

@ -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 16:30:05",
"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"
@ -157,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",
@ -179,6 +191,12 @@
"reqd": 1,
"search_index": 0
},
{
"doctype": "DocField",
"fieldname": "column_break_17",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"doctype": "DocField",
"fieldname": "company",
@ -209,6 +227,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 +246,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 +285,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 +296,7 @@
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"report": 0,
"report": 1,
"role": "Leave Approver",
"submit": 0,
"write": 1

View File

@ -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",

View File

@ -178,4 +178,11 @@ 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") # 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')",
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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

View File

@ -31,7 +31,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)