Merge branch 'master' into edge

This commit is contained in:
Anand Doshi 2013-05-22 12:23:13 +05:30
commit 176526e933
17 changed files with 217 additions and 97 deletions

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-04-10 08:35:38", "creation": "2013-04-19 11:00:07",
"docstatus": 0, "docstatus": 0,
"modified": "2013-04-17 14:05:20", "modified": "2013-05-22 12:01:56",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -224,6 +224,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Pur Order", "label": "Pur Order",
"no_copy": 1,
"oldfieldname": "purchase_order", "oldfieldname": "purchase_order",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Purchase Order", "options": "Purchase Order",
@ -238,6 +239,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Purchase Order Item", "label": "Purchase Order Item",
"no_copy": 1,
"oldfieldname": "po_detail", "oldfieldname": "po_detail",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -250,6 +252,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Pur Receipt", "label": "Pur Receipt",
"no_copy": 1,
"oldfieldname": "purchase_receipt", "oldfieldname": "purchase_receipt",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Purchase Receipt", "options": "Purchase Receipt",
@ -264,6 +267,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "PR Detail", "label": "PR Detail",
"no_copy": 1,
"oldfieldname": "pr_detail", "oldfieldname": "pr_detail",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-04-10 08:35:44", "creation": "2013-04-19 11:00:07",
"docstatus": 0, "docstatus": 0,
"modified": "2013-04-17 14:05:20", "modified": "2013-05-22 12:06:15",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -305,6 +305,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Sales Order", "label": "Sales Order",
"no_copy": 1,
"oldfieldname": "sales_order", "oldfieldname": "sales_order",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Sales Order", "options": "Sales Order",
@ -319,6 +320,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "SO Detail ", "label": "SO Detail ",
"no_copy": 1,
"oldfieldname": "so_detail", "oldfieldname": "so_detail",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -331,6 +333,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Delivery Note", "label": "Delivery Note",
"no_copy": 1,
"oldfieldname": "delivery_note", "oldfieldname": "delivery_note",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Delivery Note", "options": "Delivery Note",
@ -345,6 +348,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "DN Detail", "label": "DN Detail",
"no_copy": 1,
"oldfieldname": "dn_detail", "oldfieldname": "dn_detail",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-22 01:27:42", "creation": "2013-03-07 11:42:55",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-07 07:03:27", "modified": "2013-05-22 11:59:52",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -36,6 +36,7 @@
"oldfieldname": "schedule_date", "oldfieldname": "schedule_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
}, },
@ -49,6 +50,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"print_hide": 0, "print_hide": 0,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
}, },
@ -72,6 +74,7 @@
"oldfieldname": "item_name", "oldfieldname": "item_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
}, },
@ -83,6 +86,7 @@
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"print_width": "300px", "print_width": "300px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "300px" "width": "300px"
}, },
@ -95,6 +99,7 @@
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_width": "60px", "print_width": "60px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "60px" "width": "60px"
}, },
@ -108,6 +113,7 @@
"options": "UOM", "options": "UOM",
"print_hide": 0, "print_hide": 0,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -117,14 +123,16 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate ", "label": "Ref Rate ",
"options": "currency", "options": "currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "discount_rate", "fieldname": "discount_rate",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Discount %", "label": "Discount %",
"print_hide": 0 "print_hide": 0,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -135,7 +143,8 @@
"oldfieldname": "import_rate", "oldfieldname": "import_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "currency", "options": "currency",
"print_hide": 0 "print_hide": 0,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -153,7 +162,8 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate*", "label": "Ref Rate*",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"default": "0.00", "default": "0.00",
@ -166,6 +176,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -192,6 +203,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Warehouse", "options": "Warehouse",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 0 "reqd": 0
}, },
{ {
@ -202,6 +214,7 @@
"label": "Project Name", "label": "Project Name",
"options": "Project", "options": "Project",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 0 "report_hide": 0
}, },
{ {
@ -214,6 +227,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -237,7 +251,7 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"label": "Prevdoc DocType", "label": "Prevdoc DocType",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_doctype", "oldfieldname": "prevdoc_doctype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -250,7 +264,7 @@
"hidden": 0, "hidden": 0,
"in_filter": 1, "in_filter": 1,
"label": "Material Request No", "label": "Material Request No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_docname", "oldfieldname": "prevdoc_docname",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Material Request", "options": "Material Request",
@ -267,6 +281,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Material Request Date", "label": "Material Request Date",
"no_copy": 1,
"oldfieldname": "prevdoc_date", "oldfieldname": "prevdoc_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
@ -280,7 +295,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Material Request Detail No", "label": "Material Request Detail No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_detail_docname", "oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -294,6 +309,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 0, "in_filter": 0,
"label": "Supplier Quotation", "label": "Supplier Quotation",
"no_copy": 1,
"options": "Supplier Quotation", "options": "Supplier Quotation",
"read_only": 1, "read_only": 1,
"search_index": 0 "search_index": 0
@ -304,6 +320,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
"label": "Supplier Quotation Item", "label": "Supplier Quotation Item",
"no_copy": 1,
"options": "Supplier Quotation Item", "options": "Supplier Quotation Item",
"read_only": 1 "read_only": 1
}, },
@ -395,6 +412,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1 "print_hide": 1,
"read_only": 0
} }
] ]

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-22 01:27:43", "creation": "2013-03-07 11:42:56",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-07 07:03:32", "modified": "2013-05-22 12:02:28",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -35,6 +35,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"print_hide": 0, "print_hide": 0,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
}, },
@ -58,6 +59,7 @@
"oldfieldname": "item_name", "oldfieldname": "item_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
}, },
@ -69,6 +71,7 @@
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"print_width": "300px", "print_width": "300px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "300px" "width": "300px"
}, },
@ -81,6 +84,7 @@
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_width": "60px", "print_width": "60px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "60px" "width": "60px"
}, },
@ -94,6 +98,7 @@
"options": "UOM", "options": "UOM",
"print_hide": 0, "print_hide": 0,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -103,14 +108,16 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate ", "label": "Ref Rate ",
"options": "currency", "options": "currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "discount_rate", "fieldname": "discount_rate",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Discount %", "label": "Discount %",
"print_hide": 0 "print_hide": 0,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -121,7 +128,8 @@
"oldfieldname": "import_rate", "oldfieldname": "import_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "currency", "options": "currency",
"print_hide": 0 "print_hide": 0,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -139,7 +147,8 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate*", "label": "Ref Rate*",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"default": "0.00", "default": "0.00",
@ -152,6 +161,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -178,6 +188,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Warehouse", "options": "Warehouse",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 0 "reqd": 0
}, },
{ {
@ -188,6 +199,7 @@
"label": "Project Name", "label": "Project Name",
"options": "Project", "options": "Project",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 0 "report_hide": 0
}, },
{ {
@ -196,7 +208,7 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"label": "Prevdoc DocType", "label": "Prevdoc DocType",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_doctype", "oldfieldname": "prevdoc_doctype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -209,7 +221,7 @@
"hidden": 0, "hidden": 0,
"in_filter": 1, "in_filter": 1,
"label": "Material Request No", "label": "Material Request No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_docname", "oldfieldname": "prevdoc_docname",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Material Request", "options": "Material Request",
@ -226,6 +238,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Material Request Date", "label": "Material Request Date",
"no_copy": 1,
"oldfieldname": "prevdoc_date", "oldfieldname": "prevdoc_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
@ -239,7 +252,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Material Request Detail No", "label": "Material Request Detail No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_detail_docname", "oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -295,6 +308,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1 "print_hide": 1,
"read_only": 0
} }
] ]

View File

@ -335,15 +335,22 @@ def add_holidays(events, start, end, employee, company):
def query_for_permitted_employees(doctype, txt, searchfield, start, page_len, filters): def query_for_permitted_employees(doctype, txt, searchfield, start, page_len, filters):
txt = "%" + cstr(txt) + "%" txt = "%" + cstr(txt) + "%"
return webnotes.conn.sql("""select name, employee_name from `tabEmployee` emp if "Leave Approver" in webnotes.user.get_roles():
condition = """and (exists(select ela.name from `tabEmployee Leave Approver` ela
where ela.parent=`tabEmployee`.name and ela.leave_approver= "%s") or
not exists(select ela.name from `tabEmployee Leave Approver` ela
where ela.parent=`tabEmployee`.name)
or user_id = "%s")""" % (webnotes.session.user, webnotes.session.user)
else:
from webnotes.widgets.reportview import build_match_conditions
condition = build_match_conditions("Employee")
condition = ("and " + condition) if condition else ""
return webnotes.conn.sql("""select name, employee_name from `tabEmployee`
where status = 'Active' and docstatus < 2 and where status = 'Active' and docstatus < 2 and
(`%s` like %s or employee_name like %s) and (`%s` like %s or employee_name like %s) %s
(exists(select ela.name from `tabEmployee Leave Approver` ela
where ela.parent=emp.name and ela.leave_approver=%s) or
not exists(select ela.name from `tabEmployee Leave Approver` ela where ela.parent=emp.name)
or user_id = %s)
order by order by
case when name like %s then 0 else 1 end, case when name like %s then 0 else 1 end,
case when employee_name like %s then 0 else 1 end, case when employee_name like %s then 0 else 1 end,
name limit %s, %s""" % tuple([searchfield] + ["%s"]*8), name limit %s, %s""" % tuple([searchfield] + ["%s"]*2 + [condition] + ["%s"]*4),
(txt, txt, webnotes.session.user, webnotes.session.user, txt, txt, start, page_len)) (txt, txt, txt, txt, start, page_len))

View File

@ -0,0 +1,27 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.reload_doc("support", "doctype", "support_ticket")
webnotes.reload_doc("core", "doctype", "communication")
for d in webnotes.conn.sql("""select name, raised_by from `tabSupport Ticket`
where docstatus < 2""", as_dict=True):
tic = webnotes.get_obj("Support Ticket", d.name)
tic.set_lead_contact(d.raised_by)
webnotes.conn.sql("""update `tabSupport Ticket` set lead = %s, contact = %s, company = %s
where name = %s""", (tic.doc.lead, tic.doc.contact, tic.doc.company, d.name))

View File

@ -249,4 +249,5 @@ patch_list = [
"patches.may_2013.repost_stock_for_no_posting_time", "patches.may_2013.repost_stock_for_no_posting_time",
"patches.may_2013.p01_conversion_factor_and_aii", "patches.may_2013.p01_conversion_factor_and_aii",
"patches.may_2013.p02_update_valuation_rate", "patches.may_2013.p02_update_valuation_rate",
"patches.may_2013.p03_update_support_ticket",
] ]

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-22 01:27:52", "creation": "2013-03-07 11:42:57",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-07 07:03:29", "modified": "2013-05-22 12:08:32",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -37,6 +37,7 @@
"options": "Item", "options": "Item",
"print_hide": 0, "print_hide": 0,
"print_width": "150px", "print_width": "150px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
"width": "150px" "width": "150px"
@ -60,6 +61,7 @@
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
"print_width": "150px", "print_width": "150px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
"width": "150px" "width": "150px"
@ -73,6 +75,7 @@
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"print_hide": 0, "print_hide": 0,
"print_width": "300px", "print_width": "300px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "300px" "width": "300px"
}, },
@ -87,6 +90,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 0, "print_hide": 0,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
"width": "100px" "width": "100px"
@ -115,6 +119,7 @@
"options": "currency", "options": "currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "100px" "width": "100px"
}, },
@ -128,6 +133,7 @@
"oldfieldtype": "Float", "oldfieldtype": "Float",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"width": "100px" "width": "100px"
}, },
{ {
@ -142,6 +148,7 @@
"options": "currency", "options": "currency",
"print_hide": 0, "print_hide": 0,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"width": "100px" "width": "100px"
@ -188,6 +195,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"width": "100px" "width": "100px"
@ -291,6 +299,7 @@
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 1 "report_hide": 1
} }
] ]

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-22 01:27:52", "creation": "2013-03-07 11:42:58",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-07 07:03:30", "modified": "2013-05-22 12:09:03",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -35,6 +35,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"print_width": "150px", "print_width": "150px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
"width": "150px" "width": "150px"
@ -57,6 +58,7 @@
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
"print_width": "150", "print_width": "150",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "150" "width": "150"
}, },
@ -69,6 +71,7 @@
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"print_width": "300px", "print_width": "300px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
"width": "300px" "width": "300px"
@ -82,6 +85,7 @@
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -109,6 +113,7 @@
"options": "currency", "options": "currency",
"print_hide": 1, "print_hide": 1,
"print_width": "70px", "print_width": "70px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "70px" "width": "70px"
}, },
@ -122,6 +127,7 @@
"oldfieldtype": "Float", "oldfieldtype": "Float",
"print_hide": 1, "print_hide": 1,
"print_width": "70px", "print_width": "70px",
"read_only": 0,
"width": "70px" "width": "70px"
}, },
{ {
@ -134,6 +140,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "currency", "options": "currency",
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "100px" "width": "100px"
}, },
@ -176,6 +183,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "100px" "width": "100px"
}, },
@ -206,6 +214,7 @@
"options": "Warehouse", "options": "Warehouse",
"print_hide": 1, "print_hide": 1,
"print_width": "150px", "print_width": "150px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "150px" "width": "150px"
}, },
@ -329,6 +338,7 @@
"hidden": 0, "hidden": 0,
"in_filter": 1, "in_filter": 1,
"label": "Quotation No.", "label": "Quotation No.",
"no_copy": 1,
"oldfieldname": "prevdoc_docname", "oldfieldname": "prevdoc_docname",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Quotation", "options": "Quotation",
@ -345,6 +355,7 @@
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 1 "report_hide": 1
}, },
{ {

View File

@ -81,3 +81,4 @@ class DocType(DocTypeNestedSet):
if self.doc.slideshow: if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow from website.helpers.slideshow import get_slideshow
get_slideshow(self) get_slideshow(self)

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-04-01 10:49:21", "creation": "2013-04-22 13:15:44",
"docstatus": 0, "docstatus": 0,
"modified": "2013-04-17 17:20:58", "modified": "2013-05-22 12:05:32",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -340,6 +340,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Document Type", "label": "Document Type",
"no_copy": 1,
"oldfieldname": "prevdoc_doctype", "oldfieldname": "prevdoc_doctype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -371,6 +372,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Against Document Date", "label": "Against Document Date",
"no_copy": 1,
"oldfieldname": "prevdoc_date", "oldfieldname": "prevdoc_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
@ -383,6 +385,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Against Document Detail No", "label": "Against Document Detail No",
"no_copy": 1,
"oldfieldname": "prevdoc_detail_docname", "oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-22 01:28:03", "creation": "2013-03-07 11:42:59",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-07 07:03:28", "modified": "2013-05-22 12:01:08",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -35,6 +35,7 @@
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
"width": "100px" "width": "100px"
@ -48,6 +49,7 @@
"oldfieldname": "item_name", "oldfieldname": "item_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"reqd": 1, "reqd": 1,
"search_index": 0 "search_index": 0
}, },
@ -59,6 +61,7 @@
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"print_width": "300px", "print_width": "300px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "300px" "width": "300px"
}, },
@ -72,6 +75,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -84,6 +88,7 @@
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"width": "100px" "width": "100px"
}, },
{ {
@ -97,6 +102,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"search_index": 0, "search_index": 0,
"width": "100px" "width": "100px"
}, },
@ -110,6 +116,7 @@
"options": "UOM", "options": "UOM",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -119,14 +126,16 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate ", "label": "Ref Rate ",
"options": "currency", "options": "currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "discount_rate", "fieldname": "discount_rate",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Discount %", "label": "Discount %",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"default": "0.00", "default": "0.00",
@ -139,6 +148,7 @@
"options": "currency", "options": "currency",
"print_hide": 0, "print_hide": 0,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"width": "100px" "width": "100px"
}, },
{ {
@ -157,7 +167,8 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Ref Rate*", "label": "Ref Rate*",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"default": "0.00", "default": "0.00",
@ -170,6 +181,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -184,6 +196,7 @@
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 0, "reqd": 0,
"width": "100px" "width": "100px"
}, },
@ -198,6 +211,7 @@
"options": "Warehouse", "options": "Warehouse",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"width": "100px" "width": "100px"
}, },
{ {
@ -209,6 +223,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"
}, },
@ -235,6 +250,7 @@
"oldfieldname": "serial_no", "oldfieldname": "serial_no",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"print_hide": 0, "print_hide": 0,
"read_only": 0,
"report_hide": 0 "report_hide": 0
}, },
{ {
@ -242,7 +258,8 @@
"fieldname": "rejected_serial_no", "fieldname": "rejected_serial_no",
"fieldtype": "Text", "fieldtype": "Text",
"label": "Rejected Serial No", "label": "Rejected Serial No",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -252,7 +269,8 @@
"oldfieldname": "batch_no", "oldfieldname": "batch_no",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Batch", "options": "Batch",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -278,6 +296,7 @@
"oldfieldname": "schedule_date", "oldfieldname": "schedule_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0 "reqd": 0
}, },
@ -288,7 +307,8 @@
"in_filter": 1, "in_filter": 1,
"label": "Project Name", "label": "Project Name",
"options": "Project", "options": "Project",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -299,7 +319,8 @@
"oldfieldname": "qa_no", "oldfieldname": "qa_no",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Quality Inspection", "options": "Quality Inspection",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -336,6 +357,7 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"print_hide": 1, "print_hide": 1,
"print_width": "100px", "print_width": "100px",
"read_only": 0,
"width": "100px" "width": "100px"
}, },
{ {
@ -344,9 +366,11 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"label": "Prevdoc Doctype", "label": "Prevdoc Doctype",
"no_copy": 1,
"oldfieldname": "prevdoc_doctype", "oldfieldname": "prevdoc_doctype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1 "print_hide": 1,
"read_only": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
@ -355,7 +379,7 @@
"hidden": 0, "hidden": 0,
"in_filter": 1, "in_filter": 1,
"label": "PO No", "label": "PO No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_docname", "oldfieldname": "prevdoc_docname",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Purchase Order", "options": "Purchase Order",
@ -373,6 +397,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "PO Date", "label": "PO Date",
"no_copy": 1,
"oldfieldname": "prevdoc_date", "oldfieldname": "prevdoc_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"print_hide": 1, "print_hide": 1,
@ -418,7 +443,7 @@
"hidden": 1, "hidden": 1,
"in_filter": 1, "in_filter": 1,
"label": "Purchase Order Item No", "label": "Purchase Order Item No",
"no_copy": 0, "no_copy": 1,
"oldfieldname": "prevdoc_detail_docname", "oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"print_hide": 1, "print_hide": 1,
@ -479,6 +504,7 @@
"label": "Page Break", "label": "Page Break",
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1 "print_hide": 1,
"read_only": 0
} }
] ]

View File

@ -50,7 +50,7 @@ class SupportMailbox(POP3Mailbox):
"subject": mail.mail["Subject"], "subject": mail.mail["Subject"],
"raised_by": mail.from_email, "raised_by": mail.from_email,
"content_type": mail.content_type, "content_type": mail.content_type,
"status": "Open" "status": "Open",
}]) }])
ticket.insert() ticket.insert()
new_ticket = True new_ticket = True
@ -58,7 +58,7 @@ class SupportMailbox(POP3Mailbox):
mail.save_attachments_in_doc(ticket.doc) mail.save_attachments_in_doc(ticket.doc)
make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject, make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject,
doctype="Support Ticket", name=ticket.doc.name, doctype="Support Ticket", name=ticket.doc.name,
lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date) lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date)
if new_ticket and cint(self.email_settings.send_autoreply) and \ if new_ticket and cint(self.email_settings.send_autoreply) and \

View File

@ -18,7 +18,6 @@ from __future__ import unicode_literals
import webnotes import webnotes
from utilities.transaction_base import TransactionBase from utilities.transaction_base import TransactionBase
from home import update_feed
from webnotes.utils import now from webnotes.utils import now
class DocType(TransactionBase): class DocType(TransactionBase):
@ -44,6 +43,7 @@ class DocType(TransactionBase):
def validate(self): def validate(self):
self.update_status() self.update_status()
self.set_lead_contact(self.doc.raised_by)
if self.doc.status == "Closed": if self.doc.status == "Closed":
from webnotes.widgets.form.assign_to import clear from webnotes.widgets.form.assign_to import clear
@ -51,10 +51,20 @@ class DocType(TransactionBase):
def on_communication_sent(self, comm): def on_communication_sent(self, comm):
webnotes.conn.set(self.doc, 'status', 'Waiting for Customer') webnotes.conn.set(self.doc, 'status', 'Waiting for Customer')
if comm.lead and not self.doc.lead:
webnotes.conn.set(self.doc, 'lead', comm.lead)
if comm.contact and not self.doc.contact: def set_lead_contact(self, email_id):
webnotes.conn.set(self.doc, 'contact', comm.contact) import email.utils
email_id = email.utils.parseaddr(email_id)
if email_id:
if not self.doc.lead:
self.doc.lead = webnotes.conn.get_value("Lead", {"email_id": email_id})
if not self.doc.contact:
self.doc.contact = webnotes.conn.get_value("Contact", {"email_id": email_id})
if not self.doc.company:
self.doc.company = webnotes.conn.get_value("Lead", self.doc.lead, "company") or \
webnotes.conn.get_default("company")
def on_trash(self): def on_trash(self):
webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-31 22:22:27", "creation": "2013-02-01 10:36:25",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-31 22:17:24", "modified": "2013-05-21 16:27:46",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -23,13 +23,18 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"amend": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"name": "__common__", "name": "__common__",
"parent": "Support Ticket", "parent": "Support Ticket",
"parentfield": "permissions", "parentfield": "permissions",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0,
"read": 1, "read": 1,
"submit": 0 "report": 1,
"submit": 0,
"write": 1
}, },
{ {
"doctype": "DocType", "doctype": "DocType",
@ -191,6 +196,15 @@
"oldfieldtype": "Time", "oldfieldtype": "Time",
"read_only": 1 "read_only": 1
}, },
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"print_hide": 1,
"reqd": 0
},
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
"doctype": "DocField", "doctype": "DocField",
@ -237,51 +251,18 @@
"label": "Content Type" "label": "Content Type"
}, },
{ {
"amend": 0,
"cancel": 0, "cancel": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Guest"
"report": 1,
"role": "Guest",
"write": 1
}, },
{ {
"create": 1, "cancel": 0,
"doctype": "DocPerm", "doctype": "DocPerm",
"match": "customer", "role": "Customer"
"permlevel": 0,
"report": 1,
"role": "Customer",
"write": 1
}, },
{ {
"cancel": 1, "cancel": 1,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Support Team",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"match": "",
"permlevel": 1,
"report": 1,
"role": "Support Team",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"match": "",
"permlevel": 2,
"role": "Support Team" "role": "Support Team"
} }
] ]

View File

@ -76,10 +76,12 @@ class DocType:
self.doc.full_name = get_fullname(self.doc.owner) self.doc.full_name = get_fullname(self.doc.owner)
self.doc.updated = global_date_format(self.doc.published_on) self.doc.updated = global_date_format(self.doc.published_on)
self.doc.content_html = self.doc.content self.doc.content_html = self.doc.content
if self.doc.blogger: if self.doc.blogger:
self.doc.blogger_info = webnotes.doc("Blogger", self.doc.blogger).fields self.doc.blogger_info = webnotes.doc("Blogger", self.doc.blogger).fields
self.doc.description = self.doc.blog_intro or self.doc.content[:140] self.doc.description = self.doc.blog_intro or self.doc.content[:140]
self.doc.meta_description = self.doc.description
self.doc.categories = webnotes.conn.sql_list("select name from `tabBlog Category` order by name") self.doc.categories = webnotes.conn.sql_list("select name from `tabBlog Category` order by name")

View File

@ -44,3 +44,5 @@ class DocType():
if self.doc.slideshow: if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow from website.helpers.slideshow import get_slideshow
get_slideshow(self) get_slideshow(self)
self.doc.meta_description = self.doc.description