add project template into estimate creation to help project generation flow
This commit is contained in:
parent
8f90ef09fb
commit
54ae6d14f8
8 changed files with 118 additions and 66 deletions
|
|
@ -429,6 +429,7 @@ def upsert_estimate(data):
|
|||
"customer_address": data.get("address_name"),
|
||||
"contact_person": data.get("contact_name"),
|
||||
"letter_head": data.get("company"),
|
||||
"custom_project_template": data.get("project_template", None)
|
||||
})
|
||||
for item in data.get("items", []):
|
||||
item = json.loads(item) if isinstance(item, str) else item
|
||||
|
|
|
|||
|
|
@ -5,6 +5,17 @@ from custom_ui.db_utils import process_query_conditions, build_datatable_dict, g
|
|||
# JOB MANAGEMENT API METHODS
|
||||
# ===============================================================================
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_job_templates(company=None):
|
||||
"""Get list of job (project) templates."""
|
||||
filters = {}
|
||||
if company:
|
||||
filters["company"] = company
|
||||
try:
|
||||
templates = frappe.get_all("Project Template", fields=["*"], filters=filters)
|
||||
return build_success_response(templates)
|
||||
except Exception as e:
|
||||
return build_error_response(str(e), 500)
|
||||
|
||||
@frappe.whitelist()
|
||||
def create_job_from_sales_order(sales_order_name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue