diff --git a/frappe/core/doctype/docperm/docperm.py b/frappe/core/doctype/docperm/docperm.py index 72a48001c3..70d9cb1fdb 100644 --- a/frappe/core/doctype/docperm/docperm.py +++ b/frappe/core/doctype/docperm/docperm.py @@ -7,5 +7,5 @@ import frappe from frappe.model.document import Document class DocPerm(Document): - __doclink__ = "https://frappe.io/docs/models/core/docperm" + __doclink__ = "https://frappe.io/docs/models/v5.x/core/docperm" pass diff --git a/frappe/database.py b/frappe/database.py index 86a2c57574..50e06c7d88 100644 --- a/frappe/database.py +++ b/frappe/database.py @@ -90,7 +90,7 @@ class Database: frappe.db.sql("select name from tabCustomer where name like %s", "a%") # values as dict - frappe.db.sql("select name from tabCustomer where name like %(name)s and owner="%(owner)s", + frappe.db.sql("select name from tabCustomer where name like %(name)s and owner=%(owner)s", {"name": "a%", "owner":"test@example.com"}) """ diff --git a/frappe/email/bulk.py b/frappe/email/bulk.py index f76a87c9a1..ef5fce4358 100644 --- a/frappe/email/bulk.py +++ b/frappe/email/bulk.py @@ -56,7 +56,8 @@ def send(recipients=None, sender=None, doctype='User', email_field='email', if not recipients: recipients = [] if not sender or sender == "Administrator": - sender = get_outgoing_email_account().email_id + email_account = get_outgoing_email_account() + sender = email_account.get("sender") or email_account.email_id check_bulk_limit(len(recipients)) formatted = get_formatted_html(subject, message) diff --git a/frappe/email/doctype/email_account/email_account.json b/frappe/email/doctype/email_account/email_account.json index 65c81023e9..7e421f007c 100644 --- a/frappe/email/doctype/email_account/email_account.json +++ b/frappe/email/doctype/email_account/email_account.json @@ -32,6 +32,73 @@ "permlevel": 0, "precision": "" }, + { + "fieldname": "service", + "fieldtype": "Select", + "label": "Service", + "options": "\nGMail\nYahoo Mail\nOutlook.com", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Email Id", + "no_copy": 0, + "options": "email", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "password", + "fieldtype": "Password", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Password", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "allow_on_submit": 0, + "description": "e.g. \"Support\", \"Sales\", \"Jerry Yang\"", + "fieldname": "email_account_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Email Account Name", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, { "description": "Append as communication against this DocType (must have fields, \"Status\", \"Subject\")", "fieldname": "append_to", @@ -81,73 +148,6 @@ "search_index": 0, "set_only_once": 0 }, - { - "fieldname": "service", - "fieldtype": "Select", - "label": "Service", - "options": "\nGMail\nYahoo Mail\nOutlook.com", - "permlevel": 0, - "precision": "" - }, - { - "allow_on_submit": 0, - "fieldname": "email_id", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Email Id", - "no_copy": 0, - "options": "email", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0 - }, - { - "allow_on_submit": 0, - "description": "e.g. \"Support\", \"Sales\", \"Jerry Yang\"", - "fieldname": "email_account_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Email Account Name", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0 - }, - { - "allow_on_submit": 0, - "fieldname": "password", - "fieldtype": "Password", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Password", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0 - }, { "allow_on_submit": 0, "description": "e.g. pop.gmail.com", @@ -362,7 +362,7 @@ "is_submittable": 0, "issingle": 0, "istable": 0, - "modified": "2014-09-15 12:01:38.649639", + "modified": "2014-12-15 15:20:22.723848", "modified_by": "Administrator", "module": "Email", "name": "Email Account", diff --git a/frappe/email/smtp.py b/frappe/email/smtp.py index 5547c682dd..0303471765 100644 --- a/frappe/email/smtp.py +++ b/frappe/email/smtp.py @@ -53,7 +53,8 @@ def get_outgoing_email_account(raise_exception_not_set=True): "smtp_port": frappe.conf.get("mail_port"), "use_tls": cint(frappe.conf.get("use_ssl") or 0), "email_id": frappe.conf.get("mail_login"), - "password": frappe.conf.get("mail_password") + "password": frappe.conf.get("mail_password"), + "sender": frappe.conf.get("auto_email_id") }) email_account.from_site_config = True diff --git a/frappe/public/css/appframe.css b/frappe/public/css/appframe.css index 50a4fe8718..f3ea9b403c 100644 --- a/frappe/public/css/appframe.css +++ b/frappe/public/css/appframe.css @@ -1,8 +1,8 @@ /* appframe header */ .appframe { - padding-top: 15px; - padding-bottom: 15px; +/* padding-top: 15px; + padding-bottom: 15px;*/ } .appframe-wrapper { @@ -14,10 +14,9 @@ border-bottom: 1px solid #c7c7c7; } -.appframe-titlebar, .appframe-iconbar, .appframe-form, .appframe-primary-actions { - /*background-color: rgba(255, 255, 255, 0.7);*/ +/*.appframe-titlebar, .appframe-iconbar, .appframe-form, .appframe-primary-actions { background-color: #f9f9f9; -} +}*/ .appframe-primary-actions { border-bottom: 1px solid #c7c7c7; diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index 28fd101a2d..16c1bca8ce 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -31,6 +31,10 @@ a.form-link { font-size: 102%; } +em.link-option { + font-weight: normal; +} + .layout-main { padding-bottom: 10px; } @@ -69,8 +73,7 @@ div#freeze { .app-page { border: 1px solid #c7c7c7; - border-radius: 4px; - margin-top: 15px; + border-top: 0px; padding: 0px; overflow: hidden; } @@ -81,14 +84,17 @@ div#freeze { /* listing */ .show_filters { - padding-top: 15px; - padding-bottom: 15px; + padding: 15px; + padding-bottom: 5px; margin-bottom: 15px; border-bottom: 1px solid #c7c7c7; } -.set-filters .btn-group { +.set-filters .btn { margin-bottom: 10px; +} + +.set-filters .btn-group { margin-right: 10px; } diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 7149fbacb8..2ddc310ddd 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -810,13 +810,8 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ \ ').prependTo(this.input_area); this.$input_area = $(this.input_area); @@ -841,17 +836,6 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ setup_buttons: function() { var me = this; - // magnifier - search - this.$input_area.find(".btn-search").on("click", function() { - var doctype = me.get_options(); - if(!doctype) return; - new frappe.ui.form.LinkSelector({ - doctype: doctype, - target: me, - txt: me.get_value() - }); - }); - // open this.$input_area.find(".btn-open").on("click", function() { var value = me.get_value(); @@ -859,18 +843,25 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ frappe.set_route("Form", me.get_options(), value); }); - // new - if(this.df.fieldtype==="Dynamic Link" || frappe.model.can_create(me.df.options)) { - this.$input_area.find(".btn-new").on("click", function() { - var doctype = me.get_options(); - if(!doctype) return; - me.frm.new_doc(doctype, me); - }); + if(this.only_input) this.$input_area.find(".btn-open").remove(); + }, + open_advanced_search: function() { + var doctype = this.get_options(); + if(!doctype) return; + new frappe.ui.form.LinkSelector({ + doctype: doctype, + target: this, + txt: this.get_value() + }); + }, + new_doc: function() { + var doctype = this.get_options(); + if(!doctype) return; + if(this.frm) { + this.frm.new_doc(doctype, this); } else { - this.$input_area.find(".btn-new").remove(); + new_doc(doctype); } - - if(this.only_input) this.$input_area.find(".btn-open, .btn-new").remove(); }, setup_autocomplete: function() { var me = this; @@ -915,12 +906,22 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ no_spinner: true, args: args, callback: function(r) { - if(frappe.model.can_create(doctype)) { + if(frappe.model.can_create(doctype) + && me.df.fieldtype !== "Dynamic Link") { + // new item r.results.push({ - value: " " + __("Create a new {0}", [__(me.df.options)]) + "", - make_new: true + value: " " + + __("Create a new {0}", [__(me.df.options)]) + "", + action: me.new_doc }); }; + // advanced search + r.results.push({ + value: " " + + __("Advanced Search") + "", + action: me.open_advanced_search + }); + me.$input.cache[doctype][request.term] = r.results; response(r.results); }, @@ -933,21 +934,14 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ me.autocomplete_open = false; }, focus: function( event, ui ) { - if(ui.item.make_new) { + if(ui.item.action) { return false; } }, select: function(event, ui) { me.autocomplete_open = false; - if(ui.item.make_new) { - var doctype = me.get_options(); - if(!doctype) return; - - if (me.frm) { - me.frm.new_doc(doctype, me); - } else { - new_doc(doctype); - } + if(ui.item.action) { + ui.item.action.apply(me); return false; } diff --git a/frappe/public/js/frappe/form/layout.js b/frappe/public/js/frappe/form/layout.js index dd4458258f..e5ec156953 100644 --- a/frappe/public/js/frappe/form/layout.js +++ b/frappe/public/js/frappe/form/layout.js @@ -170,7 +170,7 @@ frappe.ui.form.Layout = Class.extend({ var section = this.section[0]; section.df = df; if(df) { - if(df.label) { + if(df.label && false) { this.labelled_section_count++; var head = $('
') + .appendTo(this.sidebar_links)).click(click); + } else { + return this.iconbar.add_btn(group, icon, label, click); + } }, add_button: function(label, click, icon, is_title) { - return this.iconbar.add_btn("1", icon, __(label), click); + return this.add_icon_btn("1", icon, __(label), click); }, add_dropdown_button: function(parent, label, click, icon) { @@ -337,7 +342,7 @@ frappe.ui.make_app_page = function(opts) { ] */ var $wrapper = $(opts.parent) - $('