Explorar el Código

Merge branch 'version-14-hotfix' into version-14-hotfix

version-14
Anoop hace 2 años
committed by GitHub
padre
commit
9f7cef20f7
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 3 ficheros con 52 adiciones y 36 borrados
  1. +3
    -3
      frappe/core/doctype/user/user.json
  2. +22
    -6
      frappe/public/js/frappe/views/kanban/kanban_view.js
  3. +27
    -27
      frappe/tests/test_db_update.py

+ 3
- 3
frappe/core/doctype/user/user.json Ver fichero

@@ -126,7 +126,7 @@
{
"fieldname": "middle_name",
"fieldtype": "Data",
"label": "Middle Name (Optional)",
"label": "Middle Name",
"oldfieldname": "middle_name",
"oldfieldtype": "Data"
},
@@ -492,7 +492,7 @@
{
"description": "Restrict user from this IP address only. Multiple IP addresses can be added by separating with commas. Also accepts partial IP addresses like (111.111.111)",
"fieldname": "restrict_ip",
"fieldtype": "Data",
"fieldtype": "Small Text",
"label": "Restrict IP",
"permlevel": 1
},
@@ -722,7 +722,7 @@
"link_fieldname": "user"
}
],
"modified": "2022-05-25 01:00:51.345319",
"modified": "2022-09-19 16:05:46.485242",
"modified_by": "Administrator",
"module": "Core",
"name": "User",


+ 22
- 6
frappe/public/js/frappe/views/kanban/kanban_view.js Ver fichero

@@ -35,12 +35,28 @@ frappe.views.KanbanView = class KanbanView extends frappe.views.ListView {
this.card_meta = this.get_card_meta();
this.page_length = 0;

this.menu_items.push({
label: __("Save filters"),
action: () => {
this.save_kanban_board_filters();
},
});
this.menu_items.push(
...[
{
label: __("Save filters"),
action: () => {
this.save_kanban_board_filters();
},
},
{
label: __("Delete Kanban Board"),
action: () => {
frappe.confirm("Are you sure you want to proceed?", () => {
frappe.db.delete_doc("Kanban Board", this.board_name).then(() => {
frappe.show_alert(`Kanban Board ${this.board_name} deleted.`);
frappe.set_route("List", this.doctype, "List");
});
});
},
},
]
);

return this.get_board();
});
}


+ 27
- 27
frappe/tests/test_db_update.py Ver fichero

@@ -40,46 +40,46 @@ class TestDBUpdate(FrappeTestCase):
frappe.reload_doctype("User", force=True)
frappe.model.meta.trim_tables("User")

make_property_setter(doctype, "restrict_ip", "unique", "1", "Int")
make_property_setter(doctype, "middle_name", "unique", "1", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertTrue(restrict_ip_in_table.unique)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertTrue(middle_name_in_table.unique)

make_property_setter(doctype, "restrict_ip", "unique", "0", "Int")
make_property_setter(doctype, "middle_name", "unique", "0", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertFalse(restrict_ip_in_table.unique)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertFalse(middle_name_in_table.unique)

make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int")
make_property_setter(doctype, "middle_name", "search_index", "1", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertTrue(restrict_ip_in_table.index)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertTrue(middle_name_in_table.index)

make_property_setter(doctype, "restrict_ip", "search_index", "0", "Int")
make_property_setter(doctype, "middle_name", "search_index", "0", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertFalse(restrict_ip_in_table.index)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertFalse(middle_name_in_table.index)

make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int")
make_property_setter(doctype, "restrict_ip", "unique", "1", "Int")
make_property_setter(doctype, "middle_name", "search_index", "1", "Check")
make_property_setter(doctype, "middle_name", "unique", "1", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertTrue(restrict_ip_in_table.index)
self.assertTrue(restrict_ip_in_table.unique)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertTrue(middle_name_in_table.index)
self.assertTrue(middle_name_in_table.unique)

make_property_setter(doctype, "restrict_ip", "search_index", "1", "Int")
make_property_setter(doctype, "restrict_ip", "unique", "0", "Int")
make_property_setter(doctype, "middle_name", "search_index", "1", "Check")
make_property_setter(doctype, "middle_name", "unique", "0", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertTrue(restrict_ip_in_table.index)
self.assertFalse(restrict_ip_in_table.unique)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertTrue(middle_name_in_table.index)
self.assertFalse(middle_name_in_table.unique)

make_property_setter(doctype, "restrict_ip", "search_index", "0", "Int")
make_property_setter(doctype, "restrict_ip", "unique", "1", "Int")
make_property_setter(doctype, "middle_name", "search_index", "0", "Check")
make_property_setter(doctype, "middle_name", "unique", "1", "Check")
frappe.db.updatedb(doctype)
restrict_ip_in_table = get_table_column("User", "restrict_ip")
self.assertFalse(restrict_ip_in_table.index)
self.assertTrue(restrict_ip_in_table.unique)
middle_name_in_table = get_table_column("User", "middle_name")
self.assertFalse(middle_name_in_table.index)
self.assertTrue(middle_name_in_table.unique)

# explicitly make a text index
frappe.db.add_index(doctype, ["email_signature(200)"])


Cargando…
Cancelar
Guardar