Skip to content

Commit

Permalink
feat: add 'Allow User Options' field to support user-defined options …
Browse files Browse the repository at this point in the history
…in Table MultiSelect (#282)
  • Loading branch information
umer2001 authored Nov 25, 2024
1 parent f58a0d7 commit 2e6e2fc
Show file tree
Hide file tree
Showing 13 changed files with 1,779 additions and 1,636 deletions.
1,233 changes: 621 additions & 612 deletions frappe/core/doctype/docfield/docfield.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frappe/core/doctype/docfield/docfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DocField(Document):
from frappe.types import DF

allow_bulk_edit: DF.Check
allow_user_options: DF.Check
allow_in_quick_entry: DF.Check
allow_on_submit: DF.Check
bold: DF.Check
Expand Down
Empty file.
37 changes: 37 additions & 0 deletions frappe/core/doctype/option/option.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-11-08 11:57:13.741513",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"en_name",
"id"
],
"fields": [
{
"fieldname": "en_name",
"fieldtype": "Data",
"label": "Name"
},
{
"fieldname": "id",
"fieldtype": "Data",
"label": "Id"
}
],
"index_web_pages_for_search": 1,
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2024-11-25 14:41:32.996628",
"modified_by": "Administrator",
"module": "Core",
"name": "Option",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
14 changes: 14 additions & 0 deletions frappe/core/doctype/option/option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2024, zaviago and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class Option(Document):
def __init__(self, *args, **kwargs):
super(Option, self).__init__(*args, **kwargs)
self.flags.allow_unregistered_fields = True

def load_from_db(self):
return self.name
Empty file.
34 changes: 34 additions & 0 deletions frappe/core/doctype/option_item/option_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-11-08 12:03:46.110980",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"option"
],
"fields": [
{
"fieldname": "option",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Option",
"options": "Option",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2024-11-25 14:52:27.066303",
"modified_by": "Administrator",
"module": "Core",
"name": "Option Item",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
11 changes: 11 additions & 0 deletions frappe/core/doctype/option_item/option_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2024, zaviago and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class OptionItem(Document):
def __init__(self, *args, **kwargs):
super(OptionItem, self).__init__(*args, **kwargs)
self.flags.allow_unregistered_fields = True
Loading

0 comments on commit 2e6e2fc

Please sign in to comment.