diff --git a/frappe/__version__.py b/frappe/__version__.py index 12cf0f14d4..db01fb213a 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1 +1 @@ -__version__ = "4.5.9" +__version__ = "4.6.0" diff --git a/frappe/core/doctype/print_format/print_format.py b/frappe/core/doctype/print_format/print_format.py index a770062147..4d414c50e5 100644 --- a/frappe/core/doctype/print_format/print_format.py +++ b/frappe/core/doctype/print_format/print_format.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe import frappe.utils +from jinja2 import TemplateSyntaxError from frappe.model.document import Document @@ -16,6 +17,12 @@ class PrintFormat(Document): self.old_doc_type = frappe.db.get_value('Print Format', self.name, 'doc_type') + jenv = frappe.get_jenv() + try: + jenv.from_string(self.html) + except TemplateSyntaxError: + frappe.throw(frappe._("Syntax error in Jinja template")) + def on_update(self): if hasattr(self, 'old_doc_type') and self.old_doc_type: frappe.clear_cache(doctype=self.old_doc_type) diff --git a/frappe/core/doctype/print_format/test_records.json b/frappe/core/doctype/print_format/test_records.json index aab3b96884..b0fac3c7ab 100644 --- a/frappe/core/doctype/print_format/test_records.json +++ b/frappe/core/doctype/print_format/test_records.json @@ -3,6 +3,7 @@ "doctype": "Print Format", "name": "_Test Print Format 1", "module": "core", - "doc_type": "User" + "doc_type": "User", + "html": "" } ] diff --git a/frappe/hooks.py b/frappe/hooks.py index f632099952..5fa757ee3a 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -3,7 +3,7 @@ app_title = "Frappe Framework" app_publisher = "Web Notes Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "assets/frappe/images/frappe.svg" -app_version = "4.5.9" +app_version = "4.6.0" app_color = "#3498db" app_email = "support@frappe.io" diff --git a/frappe/model/db_query.py b/frappe/model/db_query.py index a5c2f7b723..79ef0e63d4 100644 --- a/frappe/model/db_query.py +++ b/frappe/model/db_query.py @@ -90,7 +90,10 @@ class DatabaseQuery(object): if isinstance(self.filters, basestring): self.filters = json.loads(self.filters) if isinstance(self.fields, basestring): - self.fields = json.loads(self.fields) + if self.fields == "*": + self.fields = ["*"] + else: + self.fields = json.loads(self.fields) if isinstance(self.filters, dict): fdict = self.filters self.filters = [] diff --git a/frappe/model/naming.py b/frappe/model/naming.py index 4f1f827758..804dcc368a 100644 --- a/frappe/model/naming.py +++ b/frappe/model/naming.py @@ -84,6 +84,8 @@ def make_autoname(key, doctype=''): if not "#" in key: key = key + ".#####" + elif not "." in key: + frappe.throw(_("Invalid naming series (. missing)") + (_(" for {0}").format(doctype) if doctype else "")) n = '' l = key.split('.') diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 79b0352b6e..97e0067a79 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -96,7 +96,7 @@ frappe.views.CommunicationList = Class.extend({ "SMS": "icon-mobile-phone", }[doc.communication_medium] || "icon-envelope"; doc.avatar = frappe.get_gravatar(doc._sender_id); - var comm = $(repl('
\
\ \
\ diff --git a/frappe/public/js/frappe/views/listview.js b/frappe/public/js/frappe/views/listview.js index e80ca5ab98..e9e958aa19 100644 --- a/frappe/public/js/frappe/views/listview.js +++ b/frappe/public/js/frappe/views/listview.js @@ -514,31 +514,3 @@ frappe.views.ListView = Class.extend({ $(parent).append(repl(icon_html, {icon_class: icon_class, label: __(label) || ''})); } }); - -// embeddable -frappe.provide('frappe.views.RecordListView'); -frappe.views.RecordListView = frappe.views.DocListView.extend({ - init: function(doctype, wrapper, ListView) { - this.doctype = doctype; - this.wrapper = wrapper; - this.listview = new ListView(this, doctype); - this.listview.parent = this; - this.setup(); - }, - - setup: function() { - var me = this; - me.page_length = 10; - $(me.wrapper).empty(); - me.init_list(); - }, - - get_args: function() { - var args = this._super(); - $.each((this.default_filters || []), function(i, f) { - args.filters.push(f); - }); - args.docstatus = args.docstatus.concat((this.default_docstatus || [])); - return args; - }, -}); diff --git a/frappe/translate.py b/frappe/translate.py index 1ac0a0ccb1..bfa34d92bd 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -298,6 +298,7 @@ def read_csv_file(path): from csv import reader with codecs.open(path, 'r', 'utf-8') as msgfile: data = msgfile.read() + data = data.replace(chr(28), "").replace(chr(29), "") data = reader([r.encode('utf-8') for r in data.splitlines()]) newdata = [[unicode(val, 'utf-8') for val in row] for row in data] return newdata diff --git a/frappe/translations/ar.csv b/frappe/translations/ar.csv index 87abadafa7..fbe83ea0b5 100644 --- a/frappe/translations/ar.csv +++ b/frappe/translations/ar.csv @@ -948,7 +948,7 @@ Select Type,حدد نوع Select User or DocType to start.,حدد العضو أو DOCTYPE للبدء. Select a Banner Image first.,تحديد صورة بانر الأول. Select an image of approx width 150px with a transparent background for best results.,اختر صورة من تقريبا عرض 150px مع خلفية شفافة للحصول على أفضل النتائج. -Select dates to create a new , +Select dates to create a new ,Select dates to create a new "Select modules to be shown (based on permission). If hidden, they will be hidden for all users.",حدد وحدات ليتم عرضها (على أساس إذن ) . إذا مخفي ، وسوف تكون مخفية لجميع المستخدمين. Select or drag across time slots to create a new event.,حدد أو اسحب عبر فتحات الوقت لإنشاء حدث جديد. "Select target = ""_blank"" to open in a new page.","حدد الهدف = "" _blank "" لفتح صفحة جديدة في ." @@ -1070,7 +1070,7 @@ Table,جدول Table {0} cannot be empty,الجدول {0} لا يمكن أن تكون فارغة Tag,بطاقة Tag Name,علامة الاسم -Tags,به +Tags,علامات Tahoma,تاهوما Target,الهدف Tasks,المهام @@ -1169,7 +1169,7 @@ User Permissions Manager,مدير ضوابط المستخدم User Roles,أدوار المستخدم User Tags,الكلمات المستخدم User Type,نوع المستخدم -"User Type ""System User"" can access Desktop. ""Website User"" can only be logged into the website and portal pages. ", +"User Type ""System User"" can access Desktop. ""Website User"" can only be logged into the website and portal pages. ","User Type ""System User"" can access Desktop. ""Website User"" can only be logged into the website and portal pages. " User Vote,تصويت المستخدم User not allowed to delete {0}: {1},المستخدم لا يسمح لحذف {0}: {1} User permissions should not apply for this Link,لا ينبغي تطبيق أذونات المستخدم لهذا الرابط diff --git a/frappe/translations/de.csv b/frappe/translations/de.csv index 0dad89ed68..26081a12b9 100644 --- a/frappe/translations/de.csv +++ b/frappe/translations/de.csv @@ -8,16 +8,16 @@ "000 is black, fff is white","000 ist schwarz, fff ist weiß" 2 days ago,vor 2 Tagen "[?]"," [?] " -"\
  • field:[fieldname] - By Field\
  • naming_series: - By Naming Series (field called naming_series must be present\
  • Prompt - Prompt user for a name\
  • [series] - Series by prefix (separated by a dot); for example PRE.#####\')"">Naming Options", +"\
  • field:[fieldname] - By Field\
  • naming_series: - By Naming Series (field called naming_series must be present\
  • Prompt - Prompt user for a name\
  • [series] - Series by prefix (separated by a dot); for example PRE.#####\')"">Naming Options","\
  • field:[fieldname] - By Field\
  • naming_series: - By Naming Series (field called naming_series must be present\
  • Prompt - Prompt user for a name\
  • [series] - Series by prefix (separated by a dot); for example PRE.#####\')"">Naming Options" new type of document, neue Art von Dokument "document type..., e.g. customer"," Dokumententyp ... , z. B. Kunden " e.g. (55 + 434) / 4 or =Math.sin(Math.PI/2)..., zB (55 + 434) / 4 oder = Math.sin (Math.PI / 2) ... module name..., Modulnamen ... text in document type, Text in Dokumenttyp A user can be permitted to multiple records of the same DocType.,Ein Benutzer kann die Genehmigung für mehrere Datensätze des gleichen DocType haben. -About,Info -About Us Settings,Über uns Einstellungen -About Us Team Member,Über uns Teammitglied +About,Information +About Us Settings,"""Über uns"" Einstellungen" +About Us Team Member,"""Über uns"" Teammitglied" Action,Aktion "Actions for workflow (e.g. Approve, Cancel).","Aktionen für Workflows (z. B. genehmigen , Abbruch) ." Add,Hinzufügen @@ -27,45 +27,45 @@ Add Attachments,Anhänge hinzufügen Add Bookmark,Lesezeichen hinzufügen Add CSS,CSS hinzufügen Add Column,Spalte hinzufügen -Add Filter, +Add Filter,Filter hinzufügen Add Google Analytics ID: eg. UA-89XXX57-1. Please search help on Google Analytics for more information.,Google Analytics-ID hinzufügen: z. B. UA-89XXX57-1. Weitere Informationen finden Sie bei Google Analytics. Add Message,Nachricht hinzufügen Add New Permission Rule,Neue Berechtigungsregel hinzufügen Add Reply,Antwort hinzufügen -Add Tag, -Add Total Row,Gesamtzeile hinzufügen +Add Tag,Stichwort hinzufügen +Add Total Row,Summenzeile hinzufügen Add a New Role,Neue Rolle hinzufügen Add a banner to the site. (small banners are usually good),Der Website ein Werbebanner hinzufügen. (kleine Banner sind in der Regel gut) Add all roles,Alle Rollen hinzufügen Add attachment,Anhang hinzufügen -Add code as <script>,Code als