diff --git a/frappe/__init__.py b/frappe/__init__.py index d3e4cebd09..33ac7f8861 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -13,7 +13,7 @@ import os, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = "7.0.4" +__version__ = "7.0.5" local = Local() diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 4fca42d1ba..3fc3e508b5 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -118,17 +118,21 @@ def execute(context, method, args=None, kwargs=None): @click.command('add-to-email-queue') -@click.argument('email') +@click.argument('email-path') @pass_context -def add_to_email_queue(context, email): +def add_to_email_queue(context, email_path): "Add an email to the Email Queue" site = get_site(context) - with frappe.init_site(site): - frappe.connect() - kwargs = json.loads(email) - kwargs['delayed'] = True - frappe.sendmail(**kwargs) - frappe.db.commit() + + if os.path.isdir(email_path): + with frappe.init_site(site): + frappe.connect() + for email in os.listdir(email_path): + with open(os.path.join(email_path, email)) as email_data: + kwargs = json.load(email_data) + kwargs['delayed'] = True + frappe.sendmail(**kwargs) + frappe.db.commit() @click.command('export-doc') diff --git a/frappe/core/doctype/doctype/doctype.json b/frappe/core/doctype/doctype/doctype.json index 9a3949ef39..2974bb3159 100644 --- a/frappe/core/doctype/doctype/doctype.json +++ b/frappe/core/doctype/doctype/doctype.json @@ -10,6 +10,7 @@ "docstatus": 0, "doctype": "DocType", "document_type": "Document", + "editable_grid": 0, "fields": [ { "allow_on_submit": 0, @@ -398,7 +399,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "description": "Naming Options", + "description": "Naming Options:\n
  1. field:[fieldname] - By Field
  2. naming_series: - By Naming Series (field called naming_series must be present
  3. Prompt - Prompt user for a name
  4. [series] - Series by prefix (separated by a dot); for example PRE.#####
", "fieldname": "autoname", "fieldtype": "Data", "hidden": 0, @@ -1153,7 +1154,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-07-11 14:24:21.223885", + "modified": "2016-07-25 12:18:27.724194", "modified_by": "Administrator", "module": "Core", "name": "DocType", diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index 274ff2f8c7..8a7edfd319 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -33,6 +33,8 @@ class CustomField(Document): if not self.idx: self.idx = len(fieldnames) + 1 + self._old_fieldtype = self.db_get('fieldtype') + if not self.fieldname: frappe.throw(_("Fieldname not set for Custom Field")) @@ -44,9 +46,10 @@ class CustomField(Document): validate_fields_for_doctype(self.dt) # update the schema - # if not frappe.flags.in_test: - from frappe.model.db_schema import updatedb - updatedb(self.dt) + if (self.fieldname not in frappe.db.get_table_columns(self.dt) + or getattr(self, "_old_fieldtype", None) != self.fieldtype): + from frappe.model.db_schema import updatedb + updatedb(self.dt) def on_trash(self): # delete property setter entries diff --git a/frappe/email/doctype/email_account/email_account.py b/frappe/email/doctype/email_account/email_account.py index 845e82c315..6bd4c95ed6 100755 --- a/frappe/email/doctype/email_account/email_account.py +++ b/frappe/email/doctype/email_account/email_account.py @@ -93,30 +93,28 @@ class EmailAccount(Document): if self.enable_outgoing: if not self.smtp_server: frappe.throw(_("{0} is required").format("SMTP Server")) - if not self.password: - frappe.throw(_("{0} is required").format("Password")) server = SMTPServer(login = getattr(self, "login_id", None) \ or self.email_id, - password = self.get_password(), server = self.smtp_server, port = cint(self.smtp_port), use_ssl = cint(self.use_tls) ) + if self.password: + server.password = self.get_password() server.sess def get_server(self, in_receive=False): """Returns logged in POP3 connection object.""" - if not self.password: - frappe.throw(_("{0} is required").format("Password")) args = { "host": self.email_server, "use_ssl": self.use_ssl, "username": getattr(self, "login_id", None) or self.email_id, - "password": self.get_password(), "use_imap": self.use_imap } + if self.password: + args.password = self.get_password() if not args.get("host"): frappe.throw(_("{0} is required").format("Email Server")) diff --git a/frappe/model/document.py b/frappe/model/document.py index 7233b8623e..5f302ff788 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -239,7 +239,7 @@ class Document(BaseDocument): def save(self, *args, **kwargs): """Wrapper for _save""" - self._save(*args, **kwargs) + return self._save(*args, **kwargs) def _save(self, ignore_permissions=None): """Save the current document in the database in the **DocType**'s table or @@ -985,4 +985,4 @@ def execute_action(doctype, name, action, **kwargs): doc.add_comment('Comment', _('Action Failed') + '
' + frappe.get_traceback() + '
') - doc.notify_update() \ No newline at end of file + doc.notify_update() diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js index d31b971d21..d78f2ba664 100644 --- a/frappe/public/js/frappe/form/grid.js +++ b/frappe/public/js/frappe/form/grid.js @@ -779,6 +779,7 @@ frappe.ui.form.GridRow = Class.extend({ .attr('data-col-idx', column.column_index) .attr('placeholder', __(df.label)); } + this.set_arrow_keys(field); column.field = field; this.on_grid_fields_dict[df.fieldname] = field; this.on_grid_fields.push(field); diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index b1dc11cb50..8961fed4b4 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -96,6 +96,8 @@ frappe.views.ListSidebar = Class.extend({ // clear and render the headers again while switching me.doclistview.page.main.find(".list-headers").empty(); me.doclistview.init_headers(); + me.doclistview.init_like(); + me.doclistview.init_select_all(); me.doclistview.refresh(true); }; diff --git a/frappe/utils/fixtures.py b/frappe/utils/fixtures.py index c82ae2170b..fcb78cc868 100644 --- a/frappe/utils/fixtures.py +++ b/frappe/utils/fixtures.py @@ -20,7 +20,8 @@ def sync_fixtures(app=None): fixture_files = sorted(os.listdir(frappe.get_app_path(app, "fixtures"))) for fname in fixture_files: if fname.endswith(".json") or fname.endswith(".csv"): - import_doc(frappe.get_app_path(app, "fixtures", fname), ignore_links=True, overwrite=True) + import_doc(frappe.get_app_path(app, "fixtures", fname), + ignore_links=True, overwrite=True) import_custom_scripts(app) diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index c442bf88de..51129adada 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -15,7 +15,7 @@ class WebsiteGenerator(Document): website = frappe._dict( page_title_field = "name" ) - + def __init__(self, *args, **kwargs): self.route = None super(WebsiteGenerator, self).__init__(*args, **kwargs) @@ -35,7 +35,7 @@ class WebsiteGenerator(Document): self.route = self.make_route() if self.route: - self.route = self.route.strip('/.') + self.route = self.route.strip('/.')[:140] def make_route(self): return self.scrub(self.get(self.website.page_title_field or "name"))