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

This commit is contained in:
Nabin Hait 2013-07-16 17:24:45 +05:30
commit 618abe487d
2 changed files with 16 additions and 19 deletions

View File

@ -50,7 +50,7 @@ $.extend(erpnext.complete_setup, {
});
if(user != 'Administrator'){
$(d.appframe.$titlebar).find('.close').toggle(false); // Hide close image
d.$wrapper.find('.close').toggle(false); // Hide close image
$('header').toggle(false); // hide toolbar
}
@ -116,6 +116,7 @@ $.extend(erpnext.complete_setup, {
var inp = d.fields_dict.company_name.input;
inp.value = wn.control_panel.company_name;
inp.disabled = true;
d.fields_dict.company_name.$input.trigger("change");
}
// set first name, last name

View File

@ -186,25 +186,21 @@ class DocType:
from webnotes.model.doc import Document
for company in companies_list:
if company and company[0]:
edigest = Document('Email Digest')
edigest.name = "Default Weekly Digest - " + company[0]
edigest.company = company[0]
edigest.frequency = 'Weekly'
edigest.recipient_list = "\n".join(system_managers)
for f in ['new_leads', 'new_enquiries', 'new_quotations',
'new_sales_orders', 'new_purchase_orders',
'new_transactions', 'payables', 'payments',
'expenses_booked', 'invoiced_amount', 'collections',
'income', 'bank_balance', 'stock_below_rl',
'income_year_to_date', 'enabled']:
edigest.fields[f] = 1
exists = webnotes.conn.sql("""\
SELECT name FROM `tabEmail Digest`
WHERE name = %s""", edigest.name)
if (exists and exists[0]) and exists[0][0]:
edigest = webnotes.bean({
"doctype": "Email Digest",
"name": "Default Weekly Digest - " + company[0],
"company": company[0],
"frequency": "Weekly",
"recipient_list": "\n".join(system_managers)
})
if webnotes.conn.sql("""select name from `tabEmail Digest` where name=%s""", edigest.doc.name):
continue
else:
edigest.save(1)
for fieldname in edigest.meta.get_fieldnames({"fieldtype": "Check"}):
edigest.doc.fields[fieldname] = 1
edigest.insert()
# Get Fiscal year Details
# ------------------------