From a2a6b8ff8c36177b9b909f1f4ef4196bf0d16efc Mon Sep 17 00:00:00 2001 From: Arvind Subramanian Date: Mon, 24 Apr 2017 09:40:53 +0530 Subject: [PATCH 1/6] removed the command as below error (#3137) sudo python install.py --setup-production usage: install.py [-h] [--develop | --production] [--site SITE] [--verbose] [--user USER] [--bench-branch BENCH_BRANCH] [--repo-url REPO_URL] install.py: error: unrecognized arguments: --setup-production --- frappe/docs/user/en/bench/guides/setup-production.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frappe/docs/user/en/bench/guides/setup-production.md b/frappe/docs/user/en/bench/guides/setup-production.md index 1567cafa13..414aab10e2 100644 --- a/frappe/docs/user/en/bench/guides/setup-production.md +++ b/frappe/docs/user/en/bench/guides/setup-production.md @@ -1,8 +1,7 @@ You can setup the bench for production use by configuring two programs, Supervisor and nginx. If you want to revert your Production Setup to Development Setup refer to [these commands](https://github.com/frappe/bench/wiki/Stopping-Production-and-starting-Development) ####Easy Production Setup -These steps are automated if you pass `--setup-production` to the easy install script -or run `sudo bench setup production` +These steps are automated if you run `sudo bench setup production` ####Manual Production Setup @@ -53,4 +52,4 @@ Note: When you restart nginx after the configuration change, it might fail if you have another configuration with server block as default for port 80 (in most cases for the nginx welcome page). You will have to disable this config. Most probable places for it to exist are `/etc/nginx/conf.d/default.conf` and -`/etc/nginx/conf.d/default`. \ No newline at end of file +`/etc/nginx/conf.d/default`. From f0705719006f16ee3e7888827b2534eca389f5d6 Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Mon, 24 Apr 2017 05:12:19 +0100 Subject: [PATCH 2/6] Issue 3135 (#3138) * creates new function `print_db_config` to print out ERPNext required database settings to console * refactors `check_if_ready_for_barracuda` to make use of `print_db_config` * adds a more explicit explanation before showing the `expected_config_for_barracuda` text * adds MariaDB default configuration to documentation --- .../user/en/tutorial/setting-up-the-site.md | 16 +++++++++++++- .../user/fr/tutorial/setting-up-the-site.md | 15 +++++++++++++ .../user/pt/tutorial/setting-up-the-site.md | 15 +++++++++++++ frappe/installer.py | 21 ++++++++++++++----- 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/frappe/docs/user/en/tutorial/setting-up-the-site.md b/frappe/docs/user/en/tutorial/setting-up-the-site.md index a74d98361a..30f4b86d1f 100755 --- a/frappe/docs/user/en/tutorial/setting-up-the-site.md +++ b/frappe/docs/user/en/tutorial/setting-up-the-site.md @@ -2,7 +2,21 @@ Let us create a new site and call it `library`. -You can install a new site, by the command `bench new-site library` +*Note: Before you create any new site, you need to activate the Barracuda storage engine on your MariaDB installation.* +*Copy the following default ERPNext database settings into your `my.cnf` file.* + + [mysqld] + innodb-file-format=barracuda + innodb-file-per-table=1 + innodb-large-prefix=1 + character-set-client-handshake = FALSE + character-set-server = utf8mb4 + collation-server = utf8mb4_unicode_ci + + [mysql] + default-character-set = utf8mb4 + +You can then install a new site, by the command `bench new-site library`. This will create a new database and site folder and install `frappe` (which is also an application!) in the new site. The `frappe` application has two built-in modules **Core** and **Website**. The Core module contains the basic models for the application. Frappe is a batteries included framework and comes with a lot of built-in models. These models are called **DocTypes**. More on that later. diff --git a/frappe/docs/user/fr/tutorial/setting-up-the-site.md b/frappe/docs/user/fr/tutorial/setting-up-the-site.md index 985e124e0a..11b7aad611 100644 --- a/frappe/docs/user/fr/tutorial/setting-up-the-site.md +++ b/frappe/docs/user/fr/tutorial/setting-up-the-site.md @@ -2,6 +2,21 @@ Créons un site et appelons le `library`. +*Remarque: Avant de créer un nouveau site, vous devez activer le moteur de stockage Barracuda sur votre installation MariaDB.* +*Copiez les paramètres de base de données ERPNext par défaut suivants dans votre fichier `my.cnf`.* + + [mysqld] + innodb-file-format=barracuda + innodb-file-per-table=1 + innodb-large-prefix=1 + character-set-client-handshake = FALSE + character-set-server = utf8mb4 + collation-server = utf8mb4_unicode_ci + + [mysql] + default-character-set = utf8mb4 + + Vous pouvez installer un nouveau site avec la commande `bench new-site library` Cette commande va créer une nouvelle base de données, un repertoire et installer `frappe` (qui est aussi une application!) diff --git a/frappe/docs/user/pt/tutorial/setting-up-the-site.md b/frappe/docs/user/pt/tutorial/setting-up-the-site.md index 5ab07fa01b..90f499c9c7 100755 --- a/frappe/docs/user/pt/tutorial/setting-up-the-site.md +++ b/frappe/docs/user/pt/tutorial/setting-up-the-site.md @@ -2,6 +2,21 @@ Vamos criar um novo site e chamá-lo de `library`. +*Nota: Antes de criar um novo site, é necessário ativar o mecanismo de armazenamento Barracuda na instalação do MariaDB.* +*Copie as seguintes configurações de banco de dados ERPNext padrão para o arquivo `my.cnf`.* + + [mysqld] + innodb-file-format=barracuda + innodb-file-per-table=1 + innodb-large-prefix=1 + character-set-client-handshake = FALSE + character-set-server = utf8mb4 + collation-server = utf8mb4_unicode_ci + + [mysql] + default-character-set = utf8mb4 + + Você pode instalar um novo site, pelo comando `bench new-site library` Isto irá criar uma nova pasta para o site e um banco de dados e instalar o `frappe` (que também é uma aplicação!) No novo site. A aplicação `frappe` tem dois módulos embutidos **Core** e **WebSite**. O módulo de Core contém os modelos básicos para a aplicação. Frappe é uma estrutura como as pilhas e vem com um monte de modelos internos. Estes modelos são chamados doctypes **Mais sobre isso mais tarde**. diff --git a/frappe/installer.py b/frappe/installer.py index 22e38d476b..3a14067156 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -356,14 +356,25 @@ def check_if_ready_for_barracuda(): }.items(): if mariadb_variables.get(key) != value: - print "="*80 - print "Please add this to MariaDB's my.cnf and restart MariaDB before proceeding" - print - print expected_config_for_barracuda - print "="*80 + site = frappe.local.site + msg = ("Creation of your site - {x} failed because MariaDB is not properly {sep}" + "configured to use the Barracuda storage engine. {sep}" + "Please add the settings below to MariaDB's my.cnf, restart MariaDB then {sep}" + "run `bench new-site site17.local` again.{sep2}" + "").format(x=site, sep2="\n"*2, sep="\n") + + print_db_config(msg, expected_config_for_barracuda) sys.exit(1) # raise Exception, "MariaDB needs to be configured!" + +def print_db_config(explanation, config_text): + print ("="*80) + print (explanation) + print (config_text) + print ("="*80) + + def extract_sql_gzip(sql_gz_path): try: subprocess.check_call(['gzip', '-d', '-v', '-f', sql_gz_path]) From 638b0ef65899e2f4d5e7f1489a5a86784f745b7f Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 24 Apr 2017 10:51:01 +0530 Subject: [PATCH 3/6] [ui] Don't show remove button when allow_multiple is disabled (#3130) * [ui] Don't show remove button when allow_multiple is disabled * Reorder Public column and some ui changes in upload dialog --- frappe/public/css/desk.css | 8 +++++ frappe/public/js/frappe/upload.js | 49 +++++++++++++++++++++---------- frappe/public/less/desk.less | 11 +++++++ 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index c56cf88d86..76d352a6b9 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -583,6 +583,14 @@ fieldset[disabled] .form-control { .file-upload .uploaded-filename-display { max-width: 150px; } +.file-upload .file-public-column { + flex: 0 0 36px; + order: -1; + justify-content: flex-end; +} +.file-upload .file-public-column input[type="checkbox"] { + margin-right: 0; +} .frappe-rtl input, .frappe-rtl textarea { direction: rtl; diff --git a/frappe/public/js/frappe/upload.js b/frappe/public/js/frappe/upload.js index 1104ff4a8a..94be9d9be3 100644 --- a/frappe/public/js/frappe/upload.js +++ b/frappe/public/js/frappe/upload.js @@ -10,6 +10,9 @@ frappe.upload = { opts.allow_multiple = 1 } + // whether to show public/private checkbox or not + opts.show_private = !("is_private" in opts); + var d = null; // create new dialog if no parent given if(!opts.parent) { @@ -50,7 +53,7 @@ frappe.upload = { $uploaded_files_wrapper.removeClass('hidden').empty(); file_array = file_array.map( - file => Object.assign(file, {is_private: 1}) + file => Object.assign(file, {is_private: opts.is_private || 0}) ) $upload.data('attached_files', file_array); @@ -60,22 +63,21 @@ frappe.upload = {
${__('Filename')}
-
- ${__('Is Private')} -
+ ${opts.show_private + ? `
+ ${__('Public')} +
` + : ''}
`); var file_pills = file_array.map( - file => frappe.upload.make_file_row(file.name, !("is_private" in opts)) + file => frappe.upload.make_file_row(file, opts) ); $uploaded_files_wrapper.append(file_pills); } else { - $upload.find(".uploaded-filename").addClass("hidden") - $upload.find(".web-link-wrapper").removeClass("hidden"); - $upload.find(".private-file").addClass("hidden"); - $upload.find(".btn-browse").removeClass("btn-default").addClass("btn-primary"); + frappe.upload.show_empty_state($upload); } }); @@ -91,7 +93,7 @@ frappe.upload = { var $target = $(e.target); if ($target.is(':checkbox')) { - var is_private = $target.is(':checked'); + var is_private = !$target.is(':checked'); attached_files = attached_files.map(file => { if (file.name === filename) { @@ -99,6 +101,10 @@ frappe.upload = { } return file; }); + $uploaded_files_wrapper + .find(`.list-item-container[data-filename="${filename}"] .fa.fa-fw`) + .toggleClass('fa-lock fa-unlock-alt'); + $upload.data('attached_files', attached_files); } else if ($target.is('.uploaded-file-remove, .fa-remove')) { @@ -110,6 +116,10 @@ frappe.upload = { $uploaded_files_wrapper .find(`.list-item-container[data-filename="${filename}"]`) .remove(); + + if(attached_files.length === 0) { + frappe.upload.show_empty_state($upload); + } } }); @@ -144,16 +154,19 @@ frappe.upload = { } }); }, - make_file_row: function(filename, show_private) { + make_file_row: function(file, { show_private } = {}) { var template = ` -
+
- ${filename} + ${file.name} + +
${show_private - ? `
- + ? `
+
` : ''}
@@ -166,6 +179,12 @@ frappe.upload = { return $(template); }, + show_empty_state: function($upload) { + $upload.find(".uploaded-filename").addClass("hidden"); + $upload.find(".web-link-wrapper").removeClass("hidden"); + $upload.find(".private-file").addClass("hidden"); + $upload.find(".btn-browse").removeClass("btn-default").addClass("btn-primary"); + }, upload_multiple_files: function(files /*FileData array*/, args, opts) { var i = -1; diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less index 8a865ef5bb..2a9aeb4e64 100644 --- a/frappe/public/less/desk.less +++ b/frappe/public/less/desk.less @@ -426,6 +426,17 @@ textarea.form-control { .uploaded-filename-display { max-width: 150px; } + + .file-public-column { + flex: 0 0 36px; + order: -1; + justify-content: flex-end; + + input[type="checkbox"] { + margin-right: 0; + } + } + } .frappe-rtl input ,.frappe-rtl textarea { From e55b139bcc8bcfcef2da952e29241851800c4333 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 24 Apr 2017 12:11:33 +0530 Subject: [PATCH 4/6] Revert "[Fix] Image not allowed in Data Import Tool" --- frappe/core/page/data_import_tool/data_import_tool_columns.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/page/data_import_tool/data_import_tool_columns.html b/frappe/core/page/data_import_tool/data_import_tool_columns.html index 1f0a59ec1e..7e579607fa 100644 --- a/frappe/core/page/data_import_tool/data_import_tool_columns.html +++ b/frappe/core/page/data_import_tool/data_import_tool_columns.html @@ -3,7 +3,7 @@
{{ doctype.name }}
{% for f in doctype.fields %} - {% if (frappe.model.no_value_type.indexOf(f.fieldtype)===-1) && (f.fieldtype != "Attach") && (f.fieldtype != "Attach Image")%} + {% if (frappe.model.no_value_type.indexOf(f.fieldtype)===-1) %} {% doctype.reqd||(f.reqd=0);%}
From 58686818050d41b84bae89468ba30eb27d5a8753 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 24 Apr 2017 13:04:07 +0530 Subject: [PATCH 5/6] [urgent][fix] rearrange patch to remove in_dialog field from table --- frappe/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/patches.txt b/frappe/patches.txt index 863666fc8a..4f7b5dd422 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -8,10 +8,10 @@ frappe.patches.v6_1.rename_file_data frappe.patches.v7_0.re_route #2016-06-27 frappe.patches.v7_2.remove_in_filter execute:frappe.reload_doc('core', 'doctype', 'doctype', force=True) #2017-03-09 +frappe.patches.v8_0.drop_in_dialog execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2017-03-03 execute:frappe.reload_doc('core', 'doctype', 'docperm') #2017-03-03 frappe.patches.v8_0.drop_is_custom_from_docperm -frappe.patches.v8_0.drop_in_dialog frappe.patches.v8_0.update_records_in_global_search frappe.patches.v8_0.update_published_in_global_search execute:frappe.reload_doc('core', 'doctype', 'custom_docperm') From 9a21b94bf9bd6074b9612b3d9c071e1a90af1a2a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 24 Apr 2017 13:49:02 +0600 Subject: [PATCH 6/6] bumped to version 8.0.21 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index 15f06ad459..88daf3fee4 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.0.20' +__version__ = '8.0.21' __title__ = "Frappe Framework" local = Local()