Updated address on jobs.py
This commit is contained in:
parent
7710a7c8fe
commit
2badb6835b
1 changed files with 11 additions and 3 deletions
|
|
@ -35,6 +35,11 @@ def create_job_from_sales_order(sales_order_name):
|
|||
"custom_company": sales_order.company
|
||||
})
|
||||
new_job.insert()
|
||||
# Iterate through new tasks (if any) and set customer, address
|
||||
# job_tasks = frappe.get_all("Task", filters={"Project": new_job.name})
|
||||
# for task in job_tasks:
|
||||
# task.custom_property = new_job.job_address
|
||||
# task.save()
|
||||
return build_success_response(new_job.as_dict())
|
||||
except Exception as e:
|
||||
return build_error_response(str(e), 500)
|
||||
|
|
@ -82,12 +87,15 @@ def get_job_task_table_data(filters={}, sortings={}, page=1, page_size=10):
|
|||
order_by=processed_sortings
|
||||
)
|
||||
|
||||
|
||||
tableRows = []
|
||||
for task in tasks:
|
||||
address_name = frappe.get_value("Project", task.project, "job_address")
|
||||
full_address = frappe.get_value("Address", address_name, "full_address")
|
||||
tableRow = {}
|
||||
tableRow["id"] = task["name"]
|
||||
tableRow["subject"] = task["subject"]
|
||||
tableRow["address"] = task.get("custom_property", "")
|
||||
tableRow["address"] = full_address
|
||||
tableRow["status"] = task.get("status", "")
|
||||
tableRows.append(tableRow)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue