From 87684e2647d5de77bf1452fd38ab75798681cbc4 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 7 Sep 2023 01:29:36 +0200 Subject: [PATCH 001/393] feat: add werkzeug proxyfix to development server --- frappe/app.py | 12 +++++++++++- frappe/commands/utils.py | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/frappe/app.py b/frappe/app.py index e5d2632e08..6f3846732b 100644 --- a/frappe/app.py +++ b/frappe/app.py @@ -9,6 +9,7 @@ import re from werkzeug.exceptions import HTTPException, NotFound from werkzeug.local import LocalManager from werkzeug.middleware.profiler import ProfilerMiddleware +from werkzeug.middleware.proxy_fix import ProxyFix from werkzeug.middleware.shared_data import SharedDataMiddleware from werkzeug.wrappers import Request, Response @@ -392,7 +393,13 @@ def sync_database(rollback: bool) -> bool: def serve( - port=8000, profile=False, no_reload=False, no_threading=False, site=None, sites_path="." + port=8000, + profile=False, + no_reload=False, + no_threading=False, + site=None, + sites_path=".", + proxy=False, ): global application, _site, _sites_path _site = site @@ -406,6 +413,9 @@ def serve( if not os.environ.get("NO_STATICS"): application = application_with_statics() + if proxy or os.environ.get("USE_PROXY"): + application = ProxyFix(application, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1) + application.debug = True application.config = {"SERVER_NAME": "localhost:8000"} diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 925c75d421..9c433f01a4 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -923,6 +923,12 @@ def run_ui_tests( @click.command("serve") @click.option("--port", default=8000) @click.option("--profile", is_flag=True, default=False) +@click.option( + "--proxy", + is_flag=True, + default=False, + help="The development server may be run behind a proxy, e.g. ngrok / localtunnel", +) @click.option("--noreload", "no_reload", is_flag=True, default=False) @click.option("--nothreading", "no_threading", is_flag=True, default=False) @click.option("--with-coverage", is_flag=True, default=False) @@ -931,6 +937,7 @@ def serve( context, port=None, profile=False, + proxy=False, no_reload=False, no_threading=False, sites_path=".", @@ -952,6 +959,7 @@ def serve( frappe.app.serve( port=port, profile=profile, + proxy=proxy, no_reload=no_reload, no_threading=no_threading, site=site, From 5e7ff1c81d0b4842303701f0af859b7c33adacf7 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 7 Sep 2023 00:53:42 +0200 Subject: [PATCH 002/393] fix: add well-known openid-configuration redirect --- frappe/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/hooks.py b/frappe/hooks.py index d18ad1addc..fd32ef9cf9 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -57,6 +57,10 @@ website_route_rules = [ website_redirects = [ {"source": r"/desk(.*)", "target": r"/app\1"}, + { + "source": "/.well-known/openid-configuration", + "target": "/api/method/frappe.integrations.oauth2.openid_configuration", + }, ] base_template = "templates/base.html" From 4c415587a6b2675ecc1f37fd5548db611d5a4f61 Mon Sep 17 00:00:00 2001 From: Dhia' Alhaq Shalabi Date: Sun, 17 Sep 2023 15:55:27 +0300 Subject: [PATCH 003/393] fix: permission check for the child table in search link - Using the parent doctype by passing the reference doctype --- frappe/desk/search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/desk/search.py b/frappe/desk/search.py index fe43b7889f..6c2f68f43c 100644 --- a/frappe/desk/search.py +++ b/frappe/desk/search.py @@ -207,6 +207,7 @@ def search_widget( and has_permission( doctype, ptype="select" if frappe.only_has_select_perm(doctype) else "read", + parent_doctype=reference_doctype, ) ) ) From f086e03df06935bf85c1bb3721ae089bc45c1948 Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Wed, 20 Sep 2023 13:39:33 +0500 Subject: [PATCH 004/393] fix(ajax): error handling --- frappe/public/js/frappe/request.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/public/js/frappe/request.js b/frappe/public/js/frappe/request.js index 30e707c1fa..dd76be7f87 100644 --- a/frappe/public/js/frappe/request.js +++ b/frappe/public/js/frappe/request.js @@ -133,6 +133,7 @@ frappe.request.call = function (opts) { } else { frappe.app.handle_session_expired(); } + opts.error_callback && opts.error_callback(); }, 404: function (xhr) { frappe.msgprint({ @@ -140,6 +141,7 @@ frappe.request.call = function (opts) { indicator: "red", message: __("The resource you are looking for is not available"), }); + opts.error_callback && opts.error_callback(); }, 403: function (xhr) { if (frappe.session.user === "Guest" && frappe.session.logged_in_user !== "Guest") { @@ -169,6 +171,7 @@ frappe.request.call = function (opts) { ), }); } + opts.error_callback && opts.error_callback(); }, 508: function (xhr) { frappe.utils.play_sound("error"); @@ -179,6 +182,7 @@ frappe.request.call = function (opts) { "Another transaction is blocking this one. Please try again in a few seconds." ), }); + opts.error_callback && opts.error_callback(); }, 413: function (data, xhr) { frappe.msgprint({ @@ -188,6 +192,7 @@ frappe.request.call = function (opts) { (frappe.boot.max_file_size || 5242880) / 1048576, ]), }); + opts.error_callback && opts.error_callback(); }, 417: function (xhr) { var r = xhr.responseJSON; @@ -220,6 +225,7 @@ frappe.request.call = function (opts) { }, 502: function (xhr) { frappe.msgprint(__("Internal Server Error")); + opts.error_callback && opts.error_callback(); }, }; From d38913714c3991017353a1c8c873509a67b9185c Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Wed, 20 Sep 2023 14:42:02 +0500 Subject: [PATCH 005/393] fix(xcall): optional error message --- frappe/public/js/frappe/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/request.js b/frappe/public/js/frappe/request.js index dd76be7f87..b622037338 100644 --- a/frappe/public/js/frappe/request.js +++ b/frappe/public/js/frappe/request.js @@ -19,7 +19,7 @@ frappe.xcall = function (method, params) { resolve(r.message); }, error: (r) => { - reject(r.message); + reject(r?.message); }, }); }); From b5ff56214263c3a69536f0dfae5e8eaab1608eb6 Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Wed, 20 Sep 2023 14:49:56 +0500 Subject: [PATCH 006/393] fix(base_list): setup_filter_area error handling --- frappe/public/js/frappe/list/base_list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/list/base_list.js b/frappe/public/js/frappe/list/base_list.js index 86a1b91091..7237fa4134 100644 --- a/frappe/public/js/frappe/list/base_list.js +++ b/frappe/public/js/frappe/list/base_list.js @@ -308,7 +308,9 @@ frappe.views.BaseList = class BaseList { this.filter_area = new FilterArea(this); if (this.filters && this.filters.length > 0) { - return this.filter_area.set(this.filters); + return this.filter_area.set(this.filters).catch(() => { + this.filter_area.clear(false); + }); } } From 443ffa06d59e50413d10262c108f83620964d878 Mon Sep 17 00:00:00 2001 From: Corentin Forler <10946971+cogk@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:28:15 +0200 Subject: [PATCH 007/393] fix(NotPermittedPage): Add redirect-to even if starting with /app A page like "/appointment" would redirect to /login, but without the redirect-to parameter, which is undesired --- frappe/website/page_renderers/not_permitted_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/website/page_renderers/not_permitted_page.py b/frappe/website/page_renderers/not_permitted_page.py index 9538ba9e0c..c91b5efd80 100644 --- a/frappe/website/page_renderers/not_permitted_page.py +++ b/frappe/website/page_renderers/not_permitted_page.py @@ -15,7 +15,7 @@ class NotPermittedPage(TemplatePage): def render(self): action = f"/login?redirect-to={frappe.request.path}" - if frappe.request.path.startswith("/app"): + if frappe.request.path.startswith("/app/") or frappe.request.path == "/app": action = "/login" frappe.local.message_title = _("Not Permitted") frappe.local.response["context"] = dict( From 4708979e0fa93d2b71e9fbcbb12403fdd2a35ed6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Sep 2023 11:08:11 +0200 Subject: [PATCH 008/393] refactor: use translation context for Edit button in Grid Row --- frappe/public/js/frappe/form/grid_row.js | 2 +- frappe/translations/fr.csv | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/grid_row.js b/frappe/public/js/frappe/form/grid_row.js index 02afd301d6..505ac24c8b 100644 --- a/frappe/public/js/frappe/form/grid_row.js +++ b/frappe/public/js/frappe/form/grid_row.js @@ -338,7 +338,7 @@ export default class GridRow { this.open_form_button = $(`
${frappe.utils.icon("edit", "xs")} -
${__("Edit")}
+
${__("Edit", "", "edit-grid-row")}
`) .appendTo(this.open_form_button) diff --git a/frappe/translations/fr.csv b/frappe/translations/fr.csv index af1210cb29..a3f8cb8733 100644 --- a/frappe/translations/fr.csv +++ b/frappe/translations/fr.csv @@ -4852,3 +4852,4 @@ Published on,Publié le, Bottom,Bas, Top,Haut, List View,Vue en liste, +Edit:edit-grid-row,Détail From 07779047090e6d6675d4a31aea06b4cdff8a01b4 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Sep 2023 18:20:44 +0200 Subject: [PATCH 009/393] refactor: clean fr translation duplicate as erpnext app already have --- frappe/translations/fr.csv | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/frappe/translations/fr.csv b/frappe/translations/fr.csv index af1210cb29..9659e23f7d 100644 --- a/frappe/translations/fr.csv +++ b/frappe/translations/fr.csv @@ -151,7 +151,7 @@ Next,Suivant, No Data,Aucune Donnée, No address added yet.,Aucune adresse ajoutée., No contacts added yet.,Aucun contact ajouté., -No items found.,Aucun élément trouvé., +No items found,Aucun élément trouvé, None,Aucun, Not Permitted,Non Autorisé, Not active,Non actif, @@ -2188,7 +2188,7 @@ Select Your Region,Sélectionnez Votre Région, Select a Brand Image first.,Sélectionner une Image de Marque en premier., Select a DocType to make a new format,Sélectionner un DocType pour faire un nouveau format, Select a chat to start messaging.,Sélectionnez une conversation pour démarrer la messagerie., -Select a group node first.,Sélectionner d'abord un noeud de groupe, +Select a group node first.,Sélectionner d'abord un niveau parent, Select an existing format to edit or start a new format.,Sélectionner un format existant pour le modifier ou pour démarrer un nouveau format., Select an image of approx width 150px with a transparent background for best results.,Sélectionner une image d'une largeur d'environ 150px avec un fond transparent pour de meilleurs résultats., Select atleast 1 record for printing,Sélectionner au moins 1 enregistrement pour l'impression, @@ -3334,10 +3334,10 @@ Google Drive Integration.,Intégration de Google Drive., Google Drive has been configured.,Google Drive a été configuré., Google Integration is disabled.,L'intégration de Google est désactivée., Google Settings,Paramètres Google, -Group By,Par groupe, +Group By,Grouper par, Group By Based On,Grouper par basé sur, Group By Type,Regrouper par type, -Group By field is required to create a dashboard chart,Le champ Group By est requis pour créer un tableau de bord, +Group By field is required to create a dashboard chart,Le champ Grouper par est requis pour créer un tableau de bord, HH:mm,HH: mm, HH:mm:ss,HH: mm: ss, HOOK-.####,CROCHET-.####, @@ -3681,7 +3681,6 @@ Cancelled,Annulé, Chart,Graphique, Close,Fermer, Communication,la communication, -Compact Item Print,Impression de l'Article Compacté, Company,Société, Complete,Terminé, Completed,Terminé, @@ -3716,7 +3715,7 @@ Filters,Filtres, Get Items,Obtenir les Articles, Goal,Objectif, Group,Groupe, -Group Node,Noeud de Groupe, +Group Node,Niveau parent, Help,Aidez-moi, Help Article,Article d’Aide, Home,Accueil, @@ -3740,20 +3739,19 @@ Page {0} of {1},Page {0} sur {1}, Pending,En Attente, Phone,Téléphone, Please click on the following link to set your new password,Veuillez cliquer sur le lien suivant pour définir votre nouveau mot de passe, -Please select another payment method. Stripe does not support transactions in currency '{0}',Veuillez sélectionner une autre méthode de paiement. Stripe ne prend pas en charge les transactions en devise '{0}', Please specify,Veuillez spécifier, Printing,Impression, Priority,Priorité, Project,Projet, Quarterly,Trimestriel, -Queued,File d'Attente, -Quick Entry,Écriture Rapide, +Queued,Dans la file d'attente, +Quick Entry,Écriture rapide, Reason,Raison, Refreshing,Actualisation, Rename,Renommer, Reset,Réinitialiser, -Review,La revue, -Save,sauvegarder, +Review,Révoir, +Save,Sauvegarder, Search results for,Résultats de recherche pour, Select All,Sélectionner Tout, Send,Envoyer, @@ -3795,7 +3793,7 @@ Bold,Audacieux, CANCELLED,ANNULÉ, Calendar,Calendrier, Center,Centre, -Clear,Clair, +Clear,Nettoyer, Comment,Commentaire, Comments,Commentaires, DRAFT,BROUILLON, @@ -4145,7 +4143,6 @@ Linked Documents,Documents liés, Steps,Pas, email,email, Component,Composant, -Subtitle,Sous-titre, Prefix,Préfixe, Is Public,Est public, This chart will be available to all Users if this is set,Ce graphique sera disponible pour tous les utilisateurs si cela est défini, @@ -4439,7 +4436,7 @@ Add Space on Top,Ajouter de l'espace sur le dessus, Add Space on Bottom,Ajouter de l'espace en bas, Is Unique,Est unique, User Agent,Agent utilisateur, -Table Break,Pause de table, +Table Break,Saut de tableau, Hide Login,Masquer la connexion, Navbar Template,Modèle de barre de navigation, Navbar Template Values,Valeurs du modèle de barre de navigation, @@ -4585,7 +4582,6 @@ Shared with the following Users with Read access:{0},Partagé avec les utilisate Already in the following Users ToDo list:{0},Déjà dans la liste des tâches des utilisateurs suivante: {0}, Your assignment on {0} {1} has been removed by {2},Votre devoir sur {0} {1} a été supprimé par {2}, Invalid Credentials,Les informations d'identification invalides, -Print UOM after Quantity,Imprimer UdM après la quantité, Uncaught Server Exception,Exception de serveur non interceptée, There was an error building this page,Une erreur s'est produite lors de la construction de cette page, Hide Traceback,Masquer le traçage, From dfe1990bf7aa37ebaf80a565089413f5ceb0c7b6 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 29 Sep 2023 09:19:41 +0200 Subject: [PATCH 010/393] refactor: apply review Co-authored-by: Ankush Menat --- frappe/public/js/frappe/form/grid_row.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/grid_row.js b/frappe/public/js/frappe/form/grid_row.js index 505ac24c8b..15dd8f4fd1 100644 --- a/frappe/public/js/frappe/form/grid_row.js +++ b/frappe/public/js/frappe/form/grid_row.js @@ -338,7 +338,7 @@ export default class GridRow { this.open_form_button = $(`
${frappe.utils.icon("edit", "xs")} -
${__("Edit", "", "edit-grid-row")}
+
${__("Edit", "", "Edit grid row")}
`) .appendTo(this.open_form_button) From f04dd717c99bfe858048158c15b7417856d2ec50 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 29 Sep 2023 09:19:50 +0200 Subject: [PATCH 011/393] refactor: apply review Co-authored-by: Ankush Menat --- frappe/translations/fr.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/translations/fr.csv b/frappe/translations/fr.csv index a3f8cb8733..5a2302acb3 100644 --- a/frappe/translations/fr.csv +++ b/frappe/translations/fr.csv @@ -4852,4 +4852,4 @@ Published on,Publié le, Bottom,Bas, Top,Haut, List View,Vue en liste, -Edit:edit-grid-row,Détail +Edit,Détail,Edit grid row, From 7baab4490bdc7425be1223d71f37fb2cb066e18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Oliver=20S=C3=BCnderhauf?= <46800703+bosue@users.noreply.github.com> Date: Wed, 27 Sep 2023 23:38:24 +0200 Subject: [PATCH 012/393] fix(UX): Responsive, column-major design for multicheck elements. --- .../js/frappe/form/controls/multicheck.js | 18 ++++++++---------- frappe/templates/styles/standard.css | 4 ++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/multicheck.js b/frappe/public/js/frappe/form/controls/multicheck.js index 7b980299aa..4b2987cf45 100644 --- a/frappe/public/js/frappe/form/controls/multicheck.js +++ b/frappe/public/js/frappe/form/controls/multicheck.js @@ -14,10 +14,13 @@ frappe.ui.form.ControlMultiCheck = class ControlMultiCheck extends frappe.ui.for this.$select_buttons = this.get_select_buttons().appendTo(this.wrapper); this.$load_state.appendTo(this.wrapper); - const row = this.get_column_size() === 12 ? "" : "row"; - this.$checkbox_area = $(`
`).appendTo( - this.wrapper - ); + // In your implementation, you may use the 'columns' property to specify either of: + // - minimum column width, e.g. `"15rem"` + // - fixed number of columns, e.g. `3` + // - both minimum column width and maximum number of columns, e.g. `"15rem 5"` + const columns = this.df.columns; + this.$checkbox_area = $('
').appendTo(this.wrapper); + this.$checkbox_area.get(0).style.setProperty("--checkbox-options-columns", columns); } refresh() { @@ -145,9 +148,8 @@ frappe.ui.form.ControlMultiCheck = class ControlMultiCheck extends frappe.ui.for } get_checkbox_element(option) { - const column_size = this.get_column_size(); return $(` -
+
`); } - - get_column_size() { - return 12 / (+this.df.columns || 1); - } }; diff --git a/frappe/templates/styles/standard.css b/frappe/templates/styles/standard.css index b6ba34872e..d800893f09 100644 --- a/frappe/templates/styles/standard.css +++ b/frappe/templates/styles/standard.css @@ -78,6 +78,10 @@ margin: 20px 0px; } +.checkbox-options { + columns: var(--checkbox-options-columns); +} + .square-image { width: 100%; height: 0; From 42575d99517fa416338ef4f43725639490ac301f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Oliver=20S=C3=BCnderhauf?= <46800703+bosue@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:31:11 +0200 Subject: [PATCH 013/393] fix(UX): Bring responsive multi-column design to module and role editors --- frappe/public/js/frappe/module_editor.js | 2 +- frappe/public/js/frappe/roles_editor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/module_editor.js b/frappe/public/js/frappe/module_editor.js index 666d1393bf..b296dacdbe 100644 --- a/frappe/public/js/frappe/module_editor.js +++ b/frappe/public/js/frappe/module_editor.js @@ -9,7 +9,7 @@ frappe.ModuleEditor = class ModuleEditor { fieldname: "block_modules", fieldtype: "MultiCheck", select_all: true, - columns: 3, + columns: "15rem", get_data: () => { return this.frm.doc.__onload.all_modules.map((module) => { return { diff --git a/frappe/public/js/frappe/roles_editor.js b/frappe/public/js/frappe/roles_editor.js index 312a90a82c..32f1f07b1f 100644 --- a/frappe/public/js/frappe/roles_editor.js +++ b/frappe/public/js/frappe/roles_editor.js @@ -10,7 +10,7 @@ frappe.RoleEditor = class { fieldname: "roles", fieldtype: "MultiCheck", select_all: true, - columns: 3, + columns: "15rem", get_data: () => { return frappe .xcall("frappe.core.doctype.user.user.get_all_roles") From 6d398bdc64c0850e34567171965869ccdf4e41b9 Mon Sep 17 00:00:00 2001 From: DaizyModi Date: Mon, 2 Oct 2023 11:32:22 +0530 Subject: [PATCH 014/393] style: prevent title overriden by buttons in small screen --- frappe/public/scss/desk/mobile.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frappe/public/scss/desk/mobile.scss b/frappe/public/scss/desk/mobile.scss index 96b927e6c6..6e18e81e98 100644 --- a/frappe/public/scss/desk/mobile.scss +++ b/frappe/public/scss/desk/mobile.scss @@ -9,6 +9,15 @@ body { // overflow-x: hidden; //Prevent scroll on narrow devices // } +@media (max-width: 1080px) { + body[data-route^="Form"] { + .page-title .title-text { + @include get_textstyle("lg", "regular"); + max-width: 350px; + } + } +} + @media(max-width: 991px) { .intro-area, .footnote-area { From dc2fbdca82c33bed532d7371eebffee39969abfb Mon Sep 17 00:00:00 2001 From: DaizyModi Date: Mon, 2 Oct 2023 12:48:38 +0530 Subject: [PATCH 015/393] style: fix title for mobile screen --- frappe/public/scss/desk/mobile.scss | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frappe/public/scss/desk/mobile.scss b/frappe/public/scss/desk/mobile.scss index 6e18e81e98..5b102a71f9 100644 --- a/frappe/public/scss/desk/mobile.scss +++ b/frappe/public/scss/desk/mobile.scss @@ -9,10 +9,9 @@ body { // overflow-x: hidden; //Prevent scroll on narrow devices // } -@media (max-width: 1080px) { +@media (max-width: 1024px) { body[data-route^="Form"] { .page-title .title-text { - @include get_textstyle("lg", "regular"); max-width: 350px; } } @@ -389,3 +388,11 @@ body { } } } + +@media (max-width: 480px) { + body[data-route^="Form"] { + .page-title .title-text { + max-width: 150px; + } + } +} From 19394ca3536f987365c9b8276664c0f16062a3f5 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 2 Oct 2023 15:37:08 +0530 Subject: [PATCH 016/393] fix(UX): remove clutter from buttons on query report --- .../js/frappe/views/reports/query_report.js | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 8f010e0255..2ada1639da 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -182,26 +182,35 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { add_card_button_to_toolbar() { if (!frappe.model.can_create("Number Card")) return; - this.page.add_inner_button(__("Create Card"), () => { - this.add_card_to_dashboard(); - }); + this.page.add_inner_button( + __("Create Card"), + () => { + this.add_card_to_dashboard(); + }, + __("Actions") + ); } add_chart_buttons_to_toolbar(show) { if (!frappe.model.can_create("Dashboard Chart")) return; if (show) { this.create_chart_button && this.create_chart_button.remove(); - this.create_chart_button = this.page.add_button(__("Set Chart"), () => { - this.open_create_chart_dialog(); - }); + this.create_chart_button = this.page.add_inner_button( + __("Set Chart"), + () => { + this.open_create_chart_dialog(); + }, + __("Actions") + ); if (this.chart_fields || this.chart_options) { this.add_to_dashboard_button && this.add_to_dashboard_button.remove(); - this.add_to_dashboard_button = this.page.add_button( + this.add_to_dashboard_button = this.page.add_inner_button( __("Add Chart to Dashboard"), () => { this.add_chart_to_dashboard(); - } + }, + __("Actions") ); } } else { From ca726a82b4c80bf7ac190033af720083d94bbd6f Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 2 Oct 2023 16:12:41 +0530 Subject: [PATCH 017/393] fix: Give All role permission to read/create own address and contact --- frappe/contacts/doctype/address/address.json | 27 ++++++++++++++++---- frappe/contacts/doctype/contact/contact.json | 11 +++++--- frappe/contacts/doctype/contact/contact.py | 1 + 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/frappe/contacts/doctype/address/address.json b/frappe/contacts/doctype/address/address.json index c30299c7ad..e04988e441 100644 --- a/frappe/contacts/doctype/address/address.json +++ b/frappe/contacts/doctype/address/address.json @@ -74,8 +74,9 @@ }, { "fieldname": "state", - "fieldtype": "Data", - "label": "State/Province" + "fieldtype": "Autocomplete", + "label": "State/Province", + "mandatory_depends_on": "eval: doc.country == 'India'" }, { "fieldname": "country", @@ -91,6 +92,7 @@ "fieldname": "pincode", "fieldtype": "Data", "label": "Postal Code", + "mandatory_depends_on": "eval: doc.country == 'India' &&(gst_settings.enable_e_invoice || gst_settings.enable_e_waybill)", "search_index": 1 }, { @@ -148,7 +150,7 @@ "icon": "fa fa-map-marker", "idx": 5, "links": [], - "modified": "2020-10-21 16:14:37.284830", + "modified": "2023-10-02 11:58:04.982763", "modified_by": "Administrator", "module": "Contacts", "name": "Address", @@ -206,9 +208,24 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "All", + "share": 1, + "write": 1 } ], + "quick_entry": 1, "search_fields": "country, state", "sort_field": "modified", - "sort_order": "DESC" -} + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/frappe/contacts/doctype/contact/contact.json b/frappe/contacts/doctype/contact/contact.json index 3090746657..679d8b4c8f 100644 --- a/frappe/contacts/doctype/contact/contact.json +++ b/frappe/contacts/doctype/contact/contact.json @@ -257,7 +257,7 @@ "image_field": "image", "index_web_pages_for_search": 1, "links": [], - "modified": "2022-10-27 10:40:50.097481", + "modified": "2023-10-02 12:00:27.299156", "modified_by": "Administrator", "module": "Contacts", "name": "Contact", @@ -381,10 +381,13 @@ "write": 1 }, { - "permlevel": 1, + "create": 1, + "delete": 1, + "if_owner": 1, "read": 1, "report": 1, - "role": "All" + "role": "All", + "write": 1 } ], "show_title_field_in_link": 1, @@ -392,4 +395,4 @@ "sort_order": "ASC", "states": [], "title_field": "full_name" -} +} \ No newline at end of file diff --git a/frappe/contacts/doctype/contact/contact.py b/frappe/contacts/doctype/contact/contact.py index c1bd2f55ec..f395851f20 100644 --- a/frappe/contacts/doctype/contact/contact.py +++ b/frappe/contacts/doctype/contact/contact.py @@ -33,6 +33,7 @@ class Contact(Document): google_contacts: DF.Link | None google_contacts_id: DF.Data | None image: DF.AttachImage | None + is_billing_contact: DF.Check is_primary_contact: DF.Check last_name: DF.Data | None links: DF.Table[DynamicLink] From 89fa201d9bd69a64084acdf5c1097ac01df42c95 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 2 Oct 2023 16:49:36 +0530 Subject: [PATCH 018/393] chore: remove unintentional json updated --- frappe/contacts/doctype/address/address.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frappe/contacts/doctype/address/address.json b/frappe/contacts/doctype/address/address.json index e04988e441..6a912baa53 100644 --- a/frappe/contacts/doctype/address/address.json +++ b/frappe/contacts/doctype/address/address.json @@ -75,8 +75,7 @@ { "fieldname": "state", "fieldtype": "Autocomplete", - "label": "State/Province", - "mandatory_depends_on": "eval: doc.country == 'India'" + "label": "State/Province" }, { "fieldname": "country", @@ -92,7 +91,6 @@ "fieldname": "pincode", "fieldtype": "Data", "label": "Postal Code", - "mandatory_depends_on": "eval: doc.country == 'India' &&(gst_settings.enable_e_invoice || gst_settings.enable_e_waybill)", "search_index": 1 }, { From 99bec229fbf8e31fbdf17bb4d4b2c0bb4d9e2c96 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 2 Oct 2023 16:51:09 +0530 Subject: [PATCH 019/393] chore: remove unintentional json updated --- frappe/contacts/doctype/address/address.json | 2 +- frappe/contacts/doctype/contact/contact.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/contacts/doctype/address/address.json b/frappe/contacts/doctype/address/address.json index 6a912baa53..e192a0b8a8 100644 --- a/frappe/contacts/doctype/address/address.json +++ b/frappe/contacts/doctype/address/address.json @@ -74,7 +74,7 @@ }, { "fieldname": "state", - "fieldtype": "Autocomplete", + "fieldtype": "Data", "label": "State/Province" }, { diff --git a/frappe/contacts/doctype/contact/contact.py b/frappe/contacts/doctype/contact/contact.py index f395851f20..c1bd2f55ec 100644 --- a/frappe/contacts/doctype/contact/contact.py +++ b/frappe/contacts/doctype/contact/contact.py @@ -33,7 +33,6 @@ class Contact(Document): google_contacts: DF.Link | None google_contacts_id: DF.Data | None image: DF.AttachImage | None - is_billing_contact: DF.Check is_primary_contact: DF.Check last_name: DF.Data | None links: DF.Table[DynamicLink] From 53c795f4b8d13e0b93b0263f878fc518f9fa10e3 Mon Sep 17 00:00:00 2001 From: Sambasiva Suda Date: Tue, 3 Oct 2023 17:13:51 +0530 Subject: [PATCH 020/393] fix: Workflow Builder not updating diagram with added states/transitions in table (#22429) Co-authored-by: Shariq Ansari --- .../js/workflow_builder/WorkflowBuilder.vue | 588 +++++++++--------- .../components/Properties.vue | 26 +- .../workflow_builder/components/StateNode.vue | 20 +- .../components/TransitionEdge.vue | 16 +- frappe/public/js/workflow_builder/store.js | 84 +-- frappe/public/js/workflow_builder/utils.js | 175 ++++-- frappe/workflow/doctype/workflow/workflow.js | 28 + .../workflow_document_state.json | 9 +- .../workflow_transition.json | 9 +- 9 files changed, 531 insertions(+), 424 deletions(-) diff --git a/frappe/public/js/workflow_builder/WorkflowBuilder.vue b/frappe/public/js/workflow_builder/WorkflowBuilder.vue index 8aa8b42218..fefe8ecd60 100644 --- a/frappe/public/js/workflow_builder/WorkflowBuilder.vue +++ b/frappe/public/js/workflow_builder/WorkflowBuilder.vue @@ -1,286 +1,276 @@ @@ -61,6 +75,7 @@ function resize(e) { opacity: 1; } } + .tab-header { display: flex; justify-content: space-between; @@ -104,4 +119,23 @@ function resize(e) { display: block; } } + +.default-state { + height: calc(100vh - 196px); + + .actions { + padding: 5px; + display: flex; + justify-content: flex-end; + border-bottom: 1px solid var(--border-color); + } + .empty-state { + display: flex; + justify-content: center; + align-items: center; + height: 100%; + text-align: center; + color: var(--disabled-text-color); + } +} diff --git a/frappe/public/js/form_builder/components/Tabs.vue b/frappe/public/js/form_builder/components/Tabs.vue index 88a159d8e6..ca0b8b9bb6 100644 --- a/frappe/public/js/form_builder/components/Tabs.vue +++ b/frappe/public/js/form_builder/components/Tabs.vue @@ -13,17 +13,7 @@ let has_tabs = computed(() => store.form.layout.tabs.length > 1); store.form.active_tab = store.form.layout.tabs[0].df.name; function activate_tab(tab) { - store.form.active_tab = tab.df.name; - store.form.selected_field = tab.df; - - // scroll to active tab - nextTick(() => { - $(".tabs .tab.active")[0].scrollIntoView({ - behavior: "smooth", - inline: "center", - block: "nearest", - }); - }); + store.activate_tab(tab); } function drag_over(tab) { @@ -34,13 +24,7 @@ function drag_over(tab) { } function add_new_tab() { - let tab = { - df: store.get_df("Tab Break", "", "Tab " + (store.form.layout.tabs.length + 1)), - sections: [section_boilerplate()], - }; - - store.form.layout.tabs.push(tab); - activate_tab(tab); + store.add_new_tab(); } function add_new_section() { @@ -51,8 +35,8 @@ function add_new_section() { function is_current_tab_empty() { // check if sections have columns and it contains fields - return !store.current_tab.sections.some( - section => section.columns.some(column => column.fields.length) + return !store.current_tab.sections.some((section) => + section.columns.some((column) => column.fields.length) ); } @@ -67,7 +51,11 @@ function remove_tab() { } else { confirm_dialog( __("Delete Tab", null, "Title of confirmation dialog"), - __("Are you sure you want to delete the tab? All the sections along with fields in the tab will be moved to the previous tab.", null, "Confirmation dialog message"), + __( + "Are you sure you want to delete the tab? All the sections along with fields in the tab will be moved to the previous tab.", + null, + "Confirmation dialog message" + ), () => delete_tab(), __("Delete tab", null, "Button text"), () => delete_tab(true), @@ -109,7 +97,7 @@ function delete_tab(with_children) {