-
Notifications
You must be signed in to change notification settings - Fork 0
chore: essential doctypes #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,86 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "actions": [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "creation": "2025-08-27 19:48:34.122664", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "doctype": "DocType", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "engine": "InnoDB", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "field_order": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sender", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "user", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "column_break_yhtw", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "chat_creation", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "is_bot", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "section_break_wkcf", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "message" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fields": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "User", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "sender", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Select", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "in_list_view": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "in_standard_filter": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "label": "Sender", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "options": "User\nGenie", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read_only": 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "column_break_yhtw", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Column Break" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "chat_creation", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Datetime", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "label": "Chat Creation" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "depends_on": "eval: doc.sender == \"User\"", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "user", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Link", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "in_list_view": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "in_standard_filter": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "label": "User", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "options": "User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "is_bot", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Check", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "label": "Is Bot?" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "section_break_wkcf", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Section Break" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldname": "message", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fieldtype": "Text", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "label": "Message" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "in_create": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "links": [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "modified": "2025-08-30 18:12:26.480496", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "modified_by": "Administrator", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "module": "Nextgenie", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": "NextGenie Chat Log", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "owner": "Administrator", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "permissions": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "create": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "delete": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "email": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "export": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "print": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "report": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "role": "System Manager", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "share": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write": 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainTighten permissions and creation flow for audit integrity If this is a system-generated log, UI edits/deletes should be disallowed and quick-create disabled. "permissions": [
{
- "create": 1,
- "delete": 1,
+ "create": 0,
+ "delete": 0,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
- "write": 1
+ "write": 0
}
],
- "read_only": 1,
+ "read_only": 1,
@@
- "in_create": 1,
+ "in_create": 0,If you intend to allow UI creation/editing, drop the doctype-level Also applies to: 81-81, 60-60 🏁 Script executed: #!/bin/bash
# Locate the JSON definition for the nextgenie_chat_log doctype
FILE=$(fd nextgenie_chat_log.json -t f)
echo "Found file: $FILE"
# Show the header and metadata up through the permissions block
sed -n '1,200p' "$FILE"
# Show lines 60–100 to capture the in_create and read_only settings
sed -n '60,100p' "$FILE"Length of output: 2530 🏁 Script executed: #!/bin/bash
# Check for quick_entry in the nextgenie_chat_log doctype
grep -n '"quick_entry"' nextgenie/nextgenie/doctype/nextgenie_chat_log/nextgenie_chat_log.json || echo "no quick_entry found"Length of output: 147 Tighten NextGenie Chat Log permissions --- nextgenie/nextgenie/doctype/nextgenie_chat_log/nextgenie_chat_log.json
@@ "permissions": [
- "create": 1,
- "delete": 1,
+ "create": 0,
+ "delete": 0,
@@
- "write": 1
+ "write": 0
@@
- "in_create": 1,
+ "in_create": 0,The existing 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read_only": 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sort_field": "modified", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sort_order": "DESC", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "states": [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "track_changes": 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,5 +5,5 @@ | |
| from frappe.model.document import Document | ||
|
|
||
|
|
||
| class ChatLog(Document): | ||
| class NextGenieChatLog(Document): | ||
| pass | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Make user mandatory when sender is “User” and add an index
Prevents orphaned rows and speeds lookups.
{ "depends_on": "eval: doc.sender == \"User\"", "fieldname": "user", "fieldtype": "Link", "in_list_view": 1, "in_standard_filter": 1, "label": "User", - "options": "User" + "options": "User", + "mandatory_depends_on": "eval: doc.sender == \"User\"", + "index": 1 },📝 Committable suggestion
🤖 Prompt for AI Agents