chore: add configurable Card Type DocType (like Task Types)
This commit is contained in:
parent
c8a92009ae
commit
aa2725ae1f
8 changed files with 102 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Service Factory — ERPNext Custom App Project
|
||||
|
||||
> **Current Version: V0.1.0013** — Each completed prompt/step increments the patch number by 1 (V0.1.0000 → V0.1.0001 → V0.1.0002…). The agent automatically commits and pushes after every step.
|
||||
> **Current Version: V0.1.0014** — Each completed prompt/step increments the patch number by 1 (V0.1.0000 → V0.1.0001 → V0.1.0002…). The agent automatically commits and pushes after every step.
|
||||
|
||||
## Project Overview
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
[
|
||||
{
|
||||
"name": "SE",
|
||||
"card_type_name": "SE",
|
||||
"doctype": "Engagement Card Type"
|
||||
},
|
||||
{
|
||||
"name": "PS",
|
||||
"card_type_name": "PS",
|
||||
"doctype": "Engagement Card Type"
|
||||
},
|
||||
{
|
||||
"name": "MS",
|
||||
"card_type_name": "MS",
|
||||
"doctype": "Engagement Card Type"
|
||||
},
|
||||
{
|
||||
"name": "Support",
|
||||
"card_type_name": "Support",
|
||||
"doctype": "Engagement Card Type"
|
||||
}
|
||||
]
|
||||
|
|
@ -173,6 +173,7 @@ doctype_js = {"Engagement Card" : "doctype/engagement_card/engagement_card.js"}
|
|||
# -----------------------------------------
|
||||
fixtures = [
|
||||
{"dt": "Engagement Task Type"},
|
||||
{"dt": "Engagement Card Type"},
|
||||
]
|
||||
|
||||
# Recreate Service Factory Desktop Icon after each migrate
|
||||
|
|
|
|||
|
|
@ -64,19 +64,13 @@ frappe.ui.form.on("Engagement Card", {
|
|||
|
||||
// Filter opportunities by selected customer
|
||||
customer: function (frm) {
|
||||
if (frm.doc.customer) {
|
||||
frm.set_query("opportunity", function () {
|
||||
return {
|
||||
filters: {
|
||||
customer: frm.doc.customer,
|
||||
},
|
||||
};
|
||||
});
|
||||
// Clear opportunity if it doesn't match the new customer
|
||||
frm.set_value("opportunity", null);
|
||||
} else {
|
||||
frm.set_query("opportunity", null);
|
||||
}
|
||||
frm.set_query("opportunity", function () {
|
||||
let filters = {};
|
||||
if (frm.doc.customer) {
|
||||
filters.customer = frm.doc.customer;
|
||||
}
|
||||
return { filters: filters };
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@
|
|||
},
|
||||
{
|
||||
"fieldname": "card_type",
|
||||
"fieldtype": "Select",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Card Type",
|
||||
"options": "SE\nPS\nMS\nSupport",
|
||||
"options": "Engagement Card Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:card_type_name",
|
||||
"creation": "2026-07-16 12:00:00.000000",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Setup",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"card_type_name"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "card_type_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Card Type Name",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2026-07-16 12:00:00.000000",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Service Factory",
|
||||
"name": "Engagement Card Type",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"select": 1,
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"select": 1,
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2026, cclohmar and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EngagementCardType(Document):
|
||||
pass
|
||||
Loading…
Reference in a new issue