[profile/email] [feature] added option not to send print as email body. fix in profile delete
diff --git a/accounts/page/accounts_home/accounts_home.js b/accounts/page/accounts_home/accounts_home.js
index 403d7bd..9981ee9 100644
--- a/accounts/page/accounts_home/accounts_home.js
+++ b/accounts/page/accounts_home/accounts_home.js
@@ -39,6 +39,16 @@
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"
+ },
]
},
{
diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py
index 3af63b0..6658db3 100644
--- a/buying/doctype/supplier/supplier.py
+++ b/buying/doctype/supplier/supplier.py
@@ -106,9 +106,9 @@
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 @@
'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))
diff --git a/patches/patch_list.py b/patches/patch_list.py
index fc9855d..00dd5da 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -217,4 +217,5 @@
"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)"
]
\ No newline at end of file
diff --git a/setup/doctype/email_settings/email_settings.txt b/setup/doctype/email_settings/email_settings.txt
index 994d4c9..1de2c93 100644
--- a/setup/doctype/email_settings/email_settings.txt
+++ b/setup/doctype/email_settings/email_settings.txt
@@ -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,7 +34,9 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
+ "report": 0,
"role": "System Manager",
+ "submit": 0,
"write": 1
},
{
@@ -45,12 +44,6 @@
"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",
"fieldname": "outgoing_mails",
@@ -103,6 +96,13 @@
"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",
"fieldname": "support_ticket_mail_settings",
@@ -180,5 +180,8 @@
"fieldname": "support_autoreply",
"fieldtype": "Text",
"label": "Custom Autoreply Message"
+ },
+ {
+ "doctype": "DocPerm"
}
]
\ No newline at end of file
diff --git a/startup/boot.py b/startup/boot.py
new file mode 100644
index 0000000..574646f
--- /dev/null
+++ b/startup/boot.py
@@ -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)
+
\ No newline at end of file
diff --git a/startup/event_handlers.py b/startup/event_handlers.py
index 0b64ddf..f0c73a5 100644
--- a/startup/event_handlers.py
+++ b/startup/event_handlers.py
@@ -31,55 +31,6 @@
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 @@
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')
+
\ No newline at end of file