[profile/email] [feature] added option not to send print as email body. fix in profile delete

This commit is contained in:
Rushabh Mehta 2013-03-25 17:52:14 +05:30
parent 06d186ba98
commit 74506e96d3
6 changed files with 94 additions and 64 deletions

View File

@ -39,6 +39,16 @@ wn.module_page["Accounts"] = [
description: wn._("Structure cost centers for budgeting."),
doctype:"Cost Center"
},
{
label: wn._("Customer"),
description: wn._("Customer database."),
doctype:"Customer"
},
{
label: wn._("Supplier"),
description: wn._("Supplier database."),
doctype:"Supplier"
},
]
},
{

View File

@ -106,9 +106,9 @@ class DocType(TransactionBase):
def create_account_head(self):
if self.doc.company :
abbr = self.get_company_abbr()
parent_account = self.get_parent_account(abbr)
if not sql("select name from tabAccount where name=%s", (self.doc.name + " - " + abbr)):
parent_account = self.get_parent_account(abbr)
ac = add_ac({
'account_name': self.doc.name,
@ -121,10 +121,18 @@ class DocType(TransactionBase):
'master_name': self.doc.name,
})
msgprint(_("Created Account Head: ") + ac)
else:
self.check_parent_account(parent_account, abbr)
else :
msgprint("Please select Company under which you want to create account head")
def check_parent_account(self, parent_account, abbr):
if webnotes.conn.get_value("Account", self.doc.name + " - " + abbr,
"parent_account") != parent_account:
ac = webnotes.bean("Account", self.doc.name + " - " + abbr)
ac.doc.parent_account = parent_account
ac.save()
def get_contacts(self,nm):
if nm:
contact_details =webnotes.conn.convert_to_lists(sql("select name, CONCAT(IFNULL(first_name,''),' ',IFNULL(last_name,'')),contact_no,email_id from `tabContact` where supplier = '%s'"%nm))

View File

@ -217,4 +217,5 @@ patch_list = [
"execute:webnotes.bean('Global Defaults').save()",
"patches.march_2013.p07_update_project_in_stock_ledger",
"execute:webnotes.bean('Style Settings').save() #2013-03-25",
"execute:webnotes.conn.set_value('Email Settings', None, 'send_print_in_body_and_attachment', 1)"
]

View File

@ -1,13 +1,12 @@
[
{
"creation": "2012-07-03 13:30:55",
"creation": "2012-07-12 23:29:44",
"docstatus": 0,
"modified": "2012-07-12 16:16:27",
"modified": "2013-03-25 17:32:05",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
"_last_update": "1325570647",
"allow_copy": 1,
"allow_email": 1,
"allow_print": 1,
@ -16,9 +15,7 @@
"in_create": 1,
"issingle": 1,
"module": "Setup",
"name": "__common__",
"section_style": "Simple",
"version": 1
"name": "__common__"
},
{
"doctype": "DocField",
@ -37,19 +34,15 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 0,
"role": "System Manager",
"submit": 0,
"write": 1
},
{
"doctype": "DocType",
"name": "Email Settings"
},
{
"doctype": "DocPerm"
},
{
"doctype": "DocPerm"
},
{
"description": "Set your outgoing mail SMTP settings here. All system generated notifications, emails will go from this mail server. If you are not sure, leave this blank to use ERPNext servers (emails will still be sent from your email id) or contact your email provider.",
"doctype": "DocField",
@ -102,6 +95,13 @@
"fieldtype": "Data",
"label": "Auto Email Id"
},
{
"description": "If checked, an email with an attached HTML format will be added to part of the EMail body as well as attachment. To only send as attachment, uncheck this.",
"doctype": "DocField",
"fieldname": "send_print_in_body_and_attachment",
"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",
@ -180,5 +180,8 @@
"fieldname": "support_autoreply",
"fieldtype": "Text",
"label": "Custom Autoreply Message"
},
{
"doctype": "DocPerm"
}
]

50
startup/boot.py Normal file
View File

@ -0,0 +1,50 @@
# ERPNext: Copyright 2013 Web Notes Technologies Pvt Ltd
# GNU General Public License. See "license.txt"
from __future__ import unicode_literals
import webnotes
import home
def boot_session(bootinfo):
"""boot session - send website info if guest"""
import webnotes
import webnotes.model.doc
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
if webnotes.session['user']=='Guest':
bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page,
parent_label, parentfield
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
bootinfo['startup_code'] = \
webnotes.conn.get_value('Website Settings', None, 'startup_code')
else:
bootinfo['letter_heads'] = get_letter_heads()
import webnotes.model.doctype
bootinfo['notification_settings'] = webnotes.doc("Notification Control",
"Notification Control").get_values()
bootinfo['modules_list'] = webnotes.conn.get_global('modules_list')
# if no company, show a dialog box to create a new company
bootinfo['setup_complete'] = webnotes.conn.sql("""select name from
tabCompany limit 1""") and 'Yes' or 'No'
# load subscription info
import conf
for key in ['max_users', 'expires_on', 'max_space', 'status', 'developer_mode']:
if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
bootinfo['docs'] += webnotes.conn.sql("select name, default_currency from `tabCompany`",
as_dict=1, update={"doctype":":Company"})
def get_letter_heads():
"""load letter heads with startup"""
import webnotes
ret = webnotes.conn.sql("""select name, content from `tabLetter Head`
where ifnull(disabled,0)=0""")
return dict(ret)

View File

@ -31,55 +31,6 @@ def on_login_post_session(login_manager):
login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
webnotes.conn.commit()
def comment_added(doc):
"""add comment to feed"""
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
'<i>"' + doc.comment + '"</i>', '#6B24B3')
def boot_session(bootinfo):
"""boot session - send website info if guest"""
import webnotes
import webnotes.model.doc
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
if webnotes.session['user']=='Guest':
bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page,
parent_label, parentfield
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
bootinfo['startup_code'] = \
webnotes.conn.get_value('Website Settings', None, 'startup_code')
else:
bootinfo['letter_heads'] = get_letter_heads()
import webnotes.model.doctype
bootinfo['notification_settings'] = webnotes.doc("Notification Control",
"Notification Control").get_values()
bootinfo['modules_list'] = webnotes.conn.get_global('modules_list')
# if no company, show a dialog box to create a new company
bootinfo['setup_complete'] = webnotes.conn.sql("""select name from
tabCompany limit 1""") and 'Yes' or 'No'
# load subscription info
import conf
for key in ['max_users', 'expires_on', 'max_space', 'status', 'developer_mode']:
if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
bootinfo['docs'] += webnotes.conn.sql("select name, default_currency from `tabCompany`",
as_dict=1, update={"doctype":":Company"})
def get_letter_heads():
"""load letter heads with startup"""
import webnotes
ret = webnotes.conn.sql("""select name, content from `tabLetter Head`
where ifnull(disabled,0)=0""")
return dict(ret)
def check_if_expired():
"""check if account is expired. If expired, do not allow login"""
import conf
@ -106,3 +57,10 @@ def check_if_expired():
webnotes.response['message'] = 'Account Expired'
raise webnotes.AuthenticationError
def comment_added(doc):
"""add comment to feed"""
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
'<i>"' + doc.comment + '"</i>', '#6B24B3')