I’m currently using ERPNext to manage tasks and service delivery for my accounting company. We offer a variety of services, each with a dedicated team, unique delivery processes, automation, and workflows.
To streamline our operations, I attempted to duplicate the core “Project” Doctype, renaming it for specific services while keeping the original “Project” Doctype for general task management. My goal is to retain the same interface, activity tracking, and connections as the original “Project” Doctype, but customize the workflow and boards for each service.
However, after duplicating the “Project” Doctype, the new doctypes do not appear identical to the original. They lack the same connections and activity tracking features inherent in the core “Project” Doctype.
Steps I followed:
Navigated to the Customize Form tool in ERPNext.
Duplicated the “Project” Doctype.
Renamed and customized the new Doctype for specific services.
Issues faced:
The duplicated Doctype does not have the same layout and interface as the original “Project” Doctype.
Missing features like activity tracking and connection tabs.
Unable to retain the same connections to other doctypes.
Request for Help:
Guidance on how to duplicate the “Project” Doctype while retaining all its core features, including activity tracking and connections.
Steps to customize the workflow and boards for each new Doctype while maintaining the core functionalities.
Hi @NCP,
Thanks for your prompt reply that will be very helpfull.
please have a question.
since I have a custom doctype, do I have to create a seprate python for it and where to place it.
…
I just need step by step if possibl eor general answer so I can move further with thi splease
What I did later is I used Servet scrip intefrace within erpnext
At the beginning worked good later it didn’t I don’t know what senario caused me that, but even new installation don’t work.
the server script is enabled
and I just updated today to the latest but seems not work.
Here’s an example of my code that use to work.
# Server Script for Auto-Création de Projet et Tâches pour un nouveau client
def create_project_and_tasks(doc, method):
# Confirm that the script is triggered
frappe.msgprint(f"Script déclenché pour le client : {doc.customer_name}")
# Define the project name based on the customer name
project_name = f"Projet - {doc.customer_name}"
frappe.msgprint(f"Nom du projet : {project_name}")
# Check if the project already exists to avoid duplication
if frappe.db.exists("Project", {"project_name": project_name}):
frappe.msgprint(f"Le projet '{project_name}' existe déjà.")
return # Exit if the project already exists
# Create a new project linked to the customer
try:
project = frappe.get_doc({
"doctype": "Project",
"project_name": project_name,
"customer": doc.name,
"status": "Open"
})
project.insert()
frappe.db.commit()
frappe.msgprint(f"Projet '{project_name}' créé avec succès.")
except Exception as e:
frappe.throw(f"Échec de la création du projet : {str(e)}")
return # Exit on error
# Define a list of tasks for the project
task_names = [
"Demande de Certificat Négatif",
"Domiciliation / Contrat de Bail",
"Rédaction et Enregistrement des Statuts",
"Inscription à la Taxe Professionnelle",
"Déclaration sur l'Honneur",
"Inscription au Registre de Commerce",
"Publication de l'Annonce Légale",
"Publication au Bulletin Officiel",
"Obtention de l'ICE",
"Obtention du Code Simplifié",
"Affiliation à la CNSS"
]
# Create each task under the newly created project
for task_name in task_names:
try:
task = frappe.get_doc({
"doctype": "Task",
"subject": task_name,
"project": project.name,
"status": "Open"
})
task.insert()
frappe.db.commit()
frappe.msgprint(f"Tâche '{task_name}' créée avec succès.")
except Exception as e:
frappe.throw(f"Échec de la création de la tâche '{task_name}' : {str(e)}")
return # Exit on error
frappe.msgprint(f"Le projet '{project_name}' et les tâches associées ont été créés avec succès.")
# Link this script to the "Customer" doctype and the "After Insert" event.