job creation working
This commit is contained in:
parent
bd9e00c6f1
commit
d3818d1985
22 changed files with 591 additions and 179 deletions
|
|
@ -30,7 +30,7 @@ def after_migrate():
|
|||
frappe.clear_cache(doctype=doctype)
|
||||
frappe.reload_doctype(doctype)
|
||||
|
||||
update_address_fields()
|
||||
# update_address_fields()
|
||||
# build_frontend()
|
||||
|
||||
|
||||
|
|
@ -70,6 +70,17 @@ def add_custom_fields():
|
|||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
|
||||
print("\n🔧 Adding custom fields to doctypes...")
|
||||
|
||||
try:
|
||||
address_meta = frappe.get_meta("Address")
|
||||
address_type_params = address_meta.get_field("address_type")
|
||||
if address_type_params and "Service" not in (address_type_params.options or ""):
|
||||
print(" Adding 'Service' to Address type options...")
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
make_property_setter("Address", "address_type", "options", (address_type_params.options or "") + "\nService", "DocField")
|
||||
print(" ✅ Added 'Service' to Address address_type options.")
|
||||
except Exception as e:
|
||||
print(f" ⚠️ Failed to update Address address_type: {e}")
|
||||
|
||||
custom_fields = {
|
||||
"Customer": [
|
||||
|
|
@ -145,6 +156,13 @@ def add_custom_fields():
|
|||
options="Lead On-Site Meeting Link",
|
||||
insert_after="quotations"
|
||||
),
|
||||
dict(
|
||||
fieldname="custom_billing_address",
|
||||
label="Custom Address",
|
||||
fieldtype="Link",
|
||||
options="Address",
|
||||
insert_after="customer_name"
|
||||
),
|
||||
dict(
|
||||
fieldname="quotations",
|
||||
label="Quotations",
|
||||
|
|
@ -505,6 +523,24 @@ def add_custom_fields():
|
|||
allow_on_submit=1
|
||||
)
|
||||
],
|
||||
"Project": [
|
||||
dict(
|
||||
fieldname="job_address",
|
||||
label="Job Address",
|
||||
fieldtype="Link",
|
||||
options="Address",
|
||||
insert_after="project_name",
|
||||
description="The address where the job is being performed."
|
||||
),
|
||||
dict(
|
||||
fieldname="customer",
|
||||
label="Customer",
|
||||
fieldtype="Link",
|
||||
options="Customer",
|
||||
insert_after="job_address",
|
||||
description="The customer for whom the project is being executed."
|
||||
)
|
||||
],
|
||||
"Project Template": [
|
||||
dict(
|
||||
fieldname="company",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue