mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +00:00
[get_query] to server side
This commit is contained in:
@@ -215,13 +215,13 @@ class DocType:
|
||||
cc_list = [
|
||||
{
|
||||
'cost_center_name': self.doc.name,
|
||||
'company_name':self.doc.name,
|
||||
'company':self.doc.name,
|
||||
'group_or_ledger':'Group',
|
||||
'parent_cost_center':''
|
||||
},
|
||||
{
|
||||
'cost_center_name':'Main',
|
||||
'company_name':self.doc.name,
|
||||
'company':self.doc.name,
|
||||
'group_or_ledger':'Ledger',
|
||||
'parent_cost_center':self.doc.name + ' - ' + self.doc.abbr
|
||||
},
|
||||
@@ -266,9 +266,9 @@ class DocType:
|
||||
webnotes.conn.sql("delete from `tabAccount` where company = %s order by lft desc, rgt desc", self.doc.name)
|
||||
|
||||
#delete cost center child table - budget detail
|
||||
webnotes.conn.sql("delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc where bd.parent = cc.name and cc.company_name = %s", self.doc.name)
|
||||
webnotes.conn.sql("delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc where bd.parent = cc.name and cc.company = %s", self.doc.name)
|
||||
#delete cost center
|
||||
webnotes.conn.sql("delete from `tabCost Center` WHERE company_name = %s order by lft desc, rgt desc", self.doc.name)
|
||||
webnotes.conn.sql("delete from `tabCost Center` WHERE company = %s order by lft desc, rgt desc", self.doc.name)
|
||||
|
||||
webnotes.defaults.clear_default("company", value=self.doc.name)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-03-25 17:53:21",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-05 14:36:16",
|
||||
"modified": "2013-07-09 10:41:38",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -81,6 +81,13 @@
|
||||
"fieldtype": "Data",
|
||||
"label": "Login Id"
|
||||
},
|
||||
{
|
||||
"description": "Check this if you want to send emails as this id only (in case of restriction by your email provider).",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "always_use_login_id_as_sender",
|
||||
"fieldtype": "Check",
|
||||
"label": "Always use Login Id as sender"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "mail_password",
|
||||
@@ -101,19 +108,12 @@
|
||||
"fieldtype": "Check",
|
||||
"label": "Send Print in Body and Attachment"
|
||||
},
|
||||
{
|
||||
"description": "Set the POP3 email settings to pull emails directly from a mailbox and create Support Tickets",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "support_ticket_mail_settings",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Support Ticket Mail Settings"
|
||||
},
|
||||
{
|
||||
"description": "To automatically create Support Tickets from your incoming mail, set your POP3 settings here. You must ideally create a separate email id for the erp system so that all emails will be synced into the system from that mail id. If you are not sure, please contact your EMail Provider.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "section_break0",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Incoming Mail Setting"
|
||||
"label": "Incoming / Support Mail Setting"
|
||||
},
|
||||
{
|
||||
"description": "Check this to pull emails from your mailbox",
|
||||
|
||||
@@ -67,10 +67,15 @@ wn.pages['Setup'].onload = function(wrapper) {
|
||||
+item.title+'</a></b></div>').appendTo(row);
|
||||
|
||||
} else {
|
||||
var col = $('<div class="col col-lg-5">\
|
||||
<span class="badge">'+ item.count +'</span>'+
|
||||
' <b>' + (item.title || item.doctype) + '</b>'
|
||||
+'</div>')
|
||||
var col = $(repl('<div class="col col-lg-5">\
|
||||
<span class="badge">%(count)s</span>\
|
||||
<b><i class="%(icon)s"></i>\
|
||||
<a class="data-link">%(title)s</a></b>\
|
||||
</div>', {
|
||||
count: item.count,
|
||||
title: wn._(item.title || item.doctype),
|
||||
icon: wn.boot.doctype_icons[item.doctype]
|
||||
}))
|
||||
.appendTo(row);
|
||||
|
||||
col.find(".badge")
|
||||
@@ -91,12 +96,19 @@ wn.pages['Setup'].onload = function(wrapper) {
|
||||
$('<div class="col col-lg-1"></div>').appendTo(row);
|
||||
|
||||
if(item.doctype) {
|
||||
col.find(".badge")
|
||||
var badge = col.find(".badge, .data-link")
|
||||
.attr("data-doctype", item.doctype)
|
||||
.css({"cursor": "pointer"})
|
||||
.click(function() {
|
||||
|
||||
if(item.single) {
|
||||
badge.click(function() {
|
||||
wn.set_route("Form", $(this).attr("data-doctype"))
|
||||
})
|
||||
} else {
|
||||
badge.click(function() {
|
||||
wn.set_route(item.tree || "List", $(this).attr("data-doctype"))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// tree
|
||||
@@ -108,11 +120,13 @@ wn.pages['Setup'].onload = function(wrapper) {
|
||||
<a class="import-link"><i class="icon-upload"></i> Import</a>')
|
||||
.appendTo($links)
|
||||
|
||||
$links.find(".view-link")
|
||||
var mylink = $links.find(".view-link")
|
||||
.attr("data-doctype", item.doctype)
|
||||
.click(function() {
|
||||
wn.set_route(item.tree, item.doctype);
|
||||
})
|
||||
|
||||
mylink.click(function() {
|
||||
wn.set_route(item.tree, item.doctype);
|
||||
})
|
||||
|
||||
} else if(item.single) {
|
||||
$('<a class="view-link"><i class="icon-edit"></i> Edit</a>')
|
||||
.appendTo($links)
|
||||
|
||||
@@ -93,6 +93,8 @@ items = [
|
||||
{ "doctype": "Purchase Taxes and Charges Master" },
|
||||
{ "doctype": "Shipping Rule" },
|
||||
{ "doctype": "Currency Exchange" },
|
||||
{ "title": "Accounts Settings",
|
||||
"route": "Form/Accounts Settings", "type": "Link", "icon": "icon-cog" },
|
||||
{
|
||||
"type": "Section",
|
||||
"title": "Opening Accounts and Stock",
|
||||
@@ -146,7 +148,8 @@ items = [
|
||||
"query": "select count(*) from tabSingles where doctype='Email Settings' and field='outgoing_mail_server'"
|
||||
},
|
||||
{
|
||||
"doctype": "Support Email Settings",
|
||||
"title": "Support Email Settings",
|
||||
"doctype": "Email Settings",
|
||||
"single": 1,
|
||||
"query": "select count(*) from tabSingles where doctype='Email Settings' and field='support_host'"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user