diff --git a/.github/helper/roulette.py b/.github/helper/roulette.py index dd3081822e..9831df7f30 100644 --- a/.github/helper/roulette.py +++ b/.github/helper/roulette.py @@ -38,8 +38,12 @@ if __name__ == "__main__": pr_number = os.environ.get("PR_NUMBER") repo = os.environ.get("REPO_NAME") - if not files_list and pr_number: - files_list = get_files_list(pr_number=pr_number, repo=repo) + # this is a push build, run all builds + if not pr_number: + os.system('echo "::set-output name=build::strawberry"') + sys.exit(0) + + files_list = files_list or get_files_list(pr_number=pr_number, repo=repo) if not files_list: print("No files' changes detected. Build is shutting") diff --git a/frappe/core/doctype/doctype/doctype.json b/frappe/core/doctype/doctype/doctype.json index 6a427f71e1..63e0426eb3 100644 --- a/frappe/core/doctype/doctype/doctype.json +++ b/frappe/core/doctype/doctype/doctype.json @@ -28,6 +28,7 @@ "sb1", "autoname", "name_case", + "allow_rename", "column_break_15", "description", "documentation", @@ -39,7 +40,6 @@ "column_break_23", "hide_toolbar", "allow_copy", - "allow_rename", "allow_import", "allow_events_in_timeline", "allow_auto_repeat", @@ -276,7 +276,7 @@ "oldfieldtype": "Check" }, { - "default": "0", + "default": "1", "fieldname": "allow_rename", "fieldtype": "Check", "label": "Allow Rename", @@ -635,7 +635,7 @@ "link_fieldname": "reference_doctype" } ], - "modified": "2021-06-17 23:31:44.974199", + "modified": "2021-08-31 15:26:19.077164", "modified_by": "Administrator", "module": "Core", "name": "DocType", diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index 8de194fb00..94f25a41aa 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -193,6 +193,16 @@ class CustomizeForm(Document): if prop == "fieldtype": self.validate_fieldtype_change(df, meta_df[0].get(prop), df.get(prop)) + elif prop == "length": + old_value_length = cint(meta_df[0].get(prop)) + new_value_length = cint(df.get(prop)) + + if new_value_length and (old_value_length > new_value_length): + self.check_length_for_fieldtypes.append({'df': df, 'old_value': meta_df[0].get(prop)}) + self.validate_fieldtype_length() + else: + self.flags.update_db = True + elif prop == "allow_on_submit" and df.get(prop): if not frappe.db.get_value("DocField", {"parent": self.doc_type, "fieldname": df.fieldname}, "allow_on_submit"): diff --git a/frappe/custom/doctype/customize_form/test_customize_form.py b/frappe/custom/doctype/customize_form/test_customize_form.py index aef95cd676..266ece8a1e 100644 --- a/frappe/custom/doctype/customize_form/test_customize_form.py +++ b/frappe/custom/doctype/customize_form/test_customize_form.py @@ -188,6 +188,26 @@ class TestCustomizeForm(unittest.TestCase): def test_core_doctype_customization(self): self.assertRaises(frappe.ValidationError, self.get_customize_form, 'User') + def test_save_customization_length_field_property(self): + # Using Notification Log doctype as it doesn't have any other custom fields + d = self.get_customize_form("Notification Log") + + document_name = d.get("fields", {"fieldname": "document_name"})[0] + document_name.length = 255 + d.run_method("save_customization") + + self.assertEqual(frappe.db.get_value("Property Setter", + {"doc_type": "Notification Log", "property": "length", "field_name": "document_name"}, "value"), '255') + + self.assertTrue(d.flags.update_db) + + length = frappe.db.sql("""SELECT character_maximum_length + FROM information_schema.columns + WHERE table_name = 'tabNotification Log' + AND column_name = 'document_name'""")[0][0] + + self.assertEqual(length, 255) + def test_custom_link(self): try: # create a dummy doctype linked to Event diff --git a/frappe/email/doctype/email_account/email_account.js b/frappe/email/doctype/email_account/email_account.js index 83896e0af7..277bf43eb6 100644 --- a/frappe/email/doctype/email_account/email_account.js +++ b/frappe/email/doctype/email_account/email_account.js @@ -151,18 +151,6 @@ frappe.ui.form.on("Email Account", { callback: function (r) { if (r.message) { frm.events.set_domain_fields(frm, r.message); - } else { - frm.set_value("domain", ""); - frappe.confirm(__('Email Domain not configured for this account, Create one?'), - function () { - frappe.model.with_doctype("Email Domain", function() { - frappe.route_options = { email_id: frm.doc.email_id }; - frappe.route_flags.return_to_email_account = 1; - var doc = frappe.model.get_new_doc("Email Domain"); - frappe.set_route("Form", "Email Domain", doc.name); - }); - } - ); } } }); diff --git a/frappe/email/doctype/email_account/email_account.json b/frappe/email/doctype/email_account/email_account.json index 6d811b801f..8cfd75d839 100644 --- a/frappe/email/doctype/email_account/email_account.json +++ b/frappe/email/doctype/email_account/email_account.json @@ -7,30 +7,34 @@ "document_type": "Setup", "engine": "InnoDB", "field_order": [ + "account_section", "email_id", - "login_id_is_different", - "login_id", + "email_account_name", + "column_break_3", + "domain", + "service", + "authentication_column", "password", "awaiting_password", "ascii_encode_password", - "email_account_name", - "email_settings", - "domain", - "service", + "column_break_10", + "login_id_is_different", + "login_id", "mailbox_settings", "enable_incoming", - "use_imap", - "email_server", - "use_ssl", - "append_emails_to_sent_folder", - "incoming_port", - "attachment_limit", - "append_to", "default_incoming", + "use_imap", + "use_ssl", + "email_server", + "incoming_port", + "column_break_18", + "attachment_limit", "email_sync_option", "initial_sync_count", - "create_contact", "section_break_12", + "append_emails_to_sent_folder", + "append_to", + "create_contact", "enable_automatic_linking", "section_break_13", "notify_if_unreplied", @@ -42,6 +46,7 @@ "use_tls", "use_ssl_for_outgoing", "smtp_port", + "column_break_38", "default_outgoing", "always_use_account_email_id_as_sender", "always_use_account_name_as_sender_name", @@ -80,7 +85,7 @@ "fieldtype": "Check", "hide_days": 1, "hide_seconds": 1, - "label": "Use Different Email Login ID" + "label": "Use different login" }, { "depends_on": "login_id_is_different", @@ -122,12 +127,6 @@ "label": "Email Account Name", "unique": 1 }, - { - "fieldname": "email_settings", - "fieldtype": "Section Break", - "hide_days": 1, - "hide_seconds": 1 - }, { "depends_on": "eval:!doc.service", "fieldname": "domain", @@ -136,7 +135,7 @@ "hide_seconds": 1, "in_list_view": 1, "in_standard_filter": 1, - "label": "Domain", + "label": "Domain (optional)", "options": "Email Domain" }, { @@ -145,18 +144,18 @@ "fieldtype": "Select", "hide_days": 1, "hide_seconds": 1, - "label": "Service", + "label": "Service (optional)", "options": "\nGMail\nSendgrid\nSparkPost\nYahoo Mail\nOutlook.com\nYandex.Mail" }, { "fieldname": "mailbox_settings", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Incoming (POP/IMAP) Settings" }, { "default": "0", - "description": "Check this to pull emails from your mailbox", "fieldname": "enable_incoming", "fieldtype": "Check", "hide_days": 1, @@ -237,6 +236,7 @@ }, { "default": "250", + "depends_on": "eval: doc.enable_incoming", "description": "Total number of emails to sync in initial sync process ", "fieldname": "initial_sync_count", "fieldtype": "Select", @@ -248,7 +248,7 @@ { "depends_on": "enable_incoming", "fieldname": "section_break_13", - "fieldtype": "Section Break", + "fieldtype": "Column Break", "hide_days": 1, "hide_seconds": 1 }, @@ -282,7 +282,8 @@ "fieldname": "outgoing_mail_settings", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Outgoing (SMTP) Settings" }, { "default": "0", @@ -336,22 +337,20 @@ { "default": "0", "depends_on": "enable_outgoing", - "description": "Uses the Email Address mentioned in this Account as the Sender for all emails sent using this Account. ", "fieldname": "always_use_account_email_id_as_sender", "fieldtype": "Check", "hide_days": 1, "hide_seconds": 1, - "label": "Always use Account's Email Address as Sender" + "label": "Always use this email address as sender address" }, { "default": "0", "depends_on": "enable_outgoing", - "description": "Uses the Email Address Name mentioned in this Account as the Sender's Name for all emails sent using this Account.", "fieldname": "always_use_account_name_as_sender_name", "fieldtype": "Check", "hide_days": 1, "hide_seconds": 1, - "label": "Always use Account's Name as Sender's Name" + "label": "Always use this name as sender name" }, { "default": "1", @@ -379,10 +378,13 @@ "label": "Disable SMTP server authentication" }, { + "collapsible": 1, + "collapsible_depends_on": "add_signature", "fieldname": "signature_section", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Signature" }, { "default": "0", @@ -401,10 +403,13 @@ "label": "Signature" }, { + "collapsible": 1, + "collapsible_depends_on": "enable_auto_reply", "fieldname": "auto_reply", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Auto Reply" }, { "default": "0", @@ -424,17 +429,20 @@ "label": "Auto Reply Message" }, { + "collapsible": 1, + "collapsible_depends_on": "eval:frappe.utils.html2text(doc.footer || '')!=''", "fieldname": "set_footer", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Footer" }, { "fieldname": "footer", "fieldtype": "Text Editor", "hide_days": 1, "hide_seconds": 1, - "label": "Footer" + "label": "Footer Content" }, { "fieldname": "uidvalidity", @@ -477,7 +485,8 @@ "fieldname": "section_break_12", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Document Linking" }, { "default": "0", @@ -527,12 +536,38 @@ "fieldname": "brand_logo", "fieldtype": "Attach Image", "label": "Brand Logo" + }, + { + "fieldname": "authentication_column", + "fieldtype": "Section Break", + "label": "Authentication" + }, + { + "fieldname": "column_break_10", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_18", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_38", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "fieldname": "account_section", + "fieldtype": "Section Break", + "label": "Account" } ], "icon": "fa fa-inbox", "index_web_pages_for_search": 1, "links": [], - "modified": "2021-01-21 10:05:24.820597", + "modified": "2021-08-31 15:23:25.714366", "modified_by": "Administrator", "module": "Email", "name": "Email Account", diff --git a/frappe/public/js/frappe/data_import/data_exporter.js b/frappe/public/js/frappe/data_import/data_exporter.js index 03e6288856..8fa5a08945 100644 --- a/frappe/public/js/frappe/data_import/data_exporter.js +++ b/frappe/public/js/frappe/data_import/data_exporter.js @@ -13,6 +13,13 @@ frappe.data_import.DataExporter = class DataExporter { this.dialog = new frappe.ui.Dialog({ title: __('Export Data'), fields: [ + { + fieldtype: 'Select', + fieldname: 'file_type', + label: __('File Type'), + options: ['Excel', 'CSV'], + default: 'CSV' + }, { fieldtype: 'Select', fieldname: 'export_records', @@ -45,13 +52,6 @@ frappe.data_import.DataExporter = class DataExporter { fieldname: 'filter_area', depends_on: doc => doc.export_records === 'by_filter' }, - { - fieldtype: 'Select', - fieldname: 'file_type', - label: __('File Type'), - options: ['Excel', 'CSV'], - default: 'CSV' - }, { fieldtype: 'Section Break' }, @@ -141,7 +141,7 @@ frappe.data_import.DataExporter = class DataExporter { let for_insert = this.exporting_for === 'Insert New Records'; let section_title = for_insert ? __('Select Fields To Insert') : __('Select Fields To Update'); let $select_all_buttons = $(` -