fix: Fields Modification for Subcontracting DocTypes (#42383)

* fix: fields renaming and reordering for enhanced user experience

* fix: dashboard data for stock entry

(cherry picked from commit 302339998f)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.json
This commit is contained in:
Ninad Parikh
2024-07-25 10:18:21 +05:30
committed by Mergify
parent 2d2140aad0
commit 422824b9e7
4 changed files with 124 additions and 63 deletions

View File

@@ -83,7 +83,8 @@
"job_card", "job_card",
"amended_from", "amended_from",
"credit_note", "credit_note",
"is_return" "is_return",
"tab_connections"
], ],
"fields": [ "fields": [
{ {
@@ -683,6 +684,12 @@
"label": "Asset Repair", "label": "Asset Repair",
"options": "Asset Repair", "options": "Asset Repair",
"read_only": 1 "read_only": 1
},
{
"fieldname": "tab_connections",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
} }
], ],
"icon": "fa fa-file-text", "icon": "fa fa-file-text",

View File

@@ -0,0 +1,26 @@
from frappe import _
# Todo: non_standard_fieldnames is to be decided
def get_data():
return {
"fieldname": "stock_entry",
"non_standard_fieldnames": {
# "DocType Name": "Reference field name",
},
"internal_links": {
"Purchase Order": ["items", "purchase_order"],
"Subcontracting Order": ["items", "subcontracting_order"],
"Subcontracting Receipt": ["items", "subcontracting_receipt"],
},
"transactions": [
{
"label": _("Reference"),
"items": [
"Purchase Order",
"Subcontracting Order",
"Subcontracting Receipt",
],
},
],
}

View File

@@ -23,18 +23,6 @@
"cost_center", "cost_center",
"dimension_col_break", "dimension_col_break",
"project", "project",
"address_and_contact_section",
"supplier_address",
"address_display",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"column_break_19",
"shipping_address",
"shipping_address_display",
"billing_address",
"billing_address_display",
"section_break_24", "section_break_24",
"column_break_25", "column_break_25",
"set_warehouse", "set_warehouse",
@@ -48,10 +36,23 @@
"raw_materials_supplied_section", "raw_materials_supplied_section",
"set_reserve_warehouse", "set_reserve_warehouse",
"supplied_items", "supplied_items",
"additional_costs_section", "tab_address_and_contact",
"supplier_address",
"address_display",
"contact_person",
"contact_display",
"contact_mobile",
"contact_email",
"column_break_19",
"shipping_address",
"shipping_address_display",
"billing_address",
"billing_address_display",
"tab_additional_costs",
"distribute_additional_costs_based_on", "distribute_additional_costs_based_on",
"additional_costs", "additional_costs",
"total_additional_costs", "total_additional_costs",
"tab_other_info",
"order_status_section", "order_status_section",
"status", "status",
"column_break_39", "column_break_39",
@@ -59,7 +60,8 @@
"printing_settings_section", "printing_settings_section",
"select_print_heading", "select_print_heading",
"column_break_43", "column_break_43",
"letter_head" "letter_head",
"tab_connections"
], ],
"fields": [ "fields": [
{ {
@@ -95,7 +97,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_global_search": 1, "in_global_search": 1,
"in_standard_filter": 1, "in_standard_filter": 1,
"label": "Supplier", "label": "Job Worker",
"options": "Supplier", "options": "Supplier",
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
@@ -107,7 +109,7 @@
"fieldname": "supplier_name", "fieldname": "supplier_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_global_search": 1, "in_global_search": 1,
"label": "Supplier Name", "label": "Job Worker Name",
"read_only": 1, "read_only": 1,
"reqd": 1 "reqd": 1
}, },
@@ -115,7 +117,7 @@
"depends_on": "supplier", "depends_on": "supplier",
"fieldname": "supplier_warehouse", "fieldname": "supplier_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Supplier Warehouse", "label": "Job Worker Warehouse",
"options": "Warehouse", "options": "Warehouse",
"reqd": 1 "reqd": 1
}, },
@@ -166,9 +168,8 @@
"read_only": 1 "read_only": 1
}, },
{ {
"collapsible": 1, "fieldname": "tab_address_and_contact",
"fieldname": "address_and_contact_section", "fieldtype": "Tab Break",
"fieldtype": "Section Break",
"label": "Address and Contact" "label": "Address and Contact"
}, },
{ {
@@ -176,14 +177,19 @@
"fetch_if_empty": 1, "fetch_if_empty": 1,
"fieldname": "supplier_address", "fieldname": "supplier_address",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Supplier Address", "label": "Job Worker Address",
"options": "Address", "options": "Address",
"print_hide": 1 "print_hide": 1
}, },
{ {
"fieldname": "address_display", "fieldname": "address_display",
<<<<<<< HEAD
"fieldtype": "Small Text", "fieldtype": "Small Text",
"label": "Supplier Address Details", "label": "Supplier Address Details",
=======
"fieldtype": "Text Editor",
"label": "Job Worker Address Details",
>>>>>>> 302339998f (fix: Fields Modification for Subcontracting DocTypes (#42383))
"read_only": 1 "read_only": 1
}, },
{ {
@@ -191,7 +197,7 @@
"fetch_if_empty": 1, "fetch_if_empty": 1,
"fieldname": "contact_person", "fieldname": "contact_person",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Supplier Contact", "label": "Job Worker Contact",
"options": "Contact", "options": "Contact",
"print_hide": 1 "print_hide": 1
}, },
@@ -337,11 +343,9 @@
"read_only": 1 "read_only": 1
}, },
{ {
"collapsible": 1,
"collapsible_depends_on": "total_additional_costs",
"depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)", "depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
"fieldname": "additional_costs_section", "fieldname": "tab_additional_costs",
"fieldtype": "Section Break", "fieldtype": "Tab Break",
"label": "Additional Costs" "label": "Additional Costs"
}, },
{ {
@@ -449,6 +453,17 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Project", "label": "Project",
"options": "Project" "options": "Project"
},
{
"fieldname": "tab_other_info",
"fieldtype": "Tab Break",
"label": "Other Info"
},
{
"fieldname": "tab_connections",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
} }
], ],
"icon": "fa fa-file-text", "icon": "fa fa-file-text",

View File

@@ -23,18 +23,6 @@
"cost_center", "cost_center",
"dimension_col_break", "dimension_col_break",
"project", "project",
"section_addresses",
"supplier_address",
"contact_person",
"address_display",
"contact_display",
"contact_mobile",
"contact_email",
"col_break_address",
"shipping_address",
"shipping_address_display",
"billing_address",
"billing_address_display",
"sec_warehouse", "sec_warehouse",
"set_warehouse", "set_warehouse",
"rejected_warehouse", "rejected_warehouse",
@@ -53,23 +41,36 @@
"get_current_stock", "get_current_stock",
"raw_material_details", "raw_material_details",
"supplied_items", "supplied_items",
"additional_costs_section",
"distribute_additional_costs_based_on",
"additional_costs",
"total_additional_costs",
"section_break_46", "section_break_46",
"in_words", "in_words",
"bill_no", "bill_no",
"bill_date", "bill_date",
"tab_addresses",
"supplier_address",
"contact_person",
"address_display",
"contact_display",
"contact_mobile",
"contact_email",
"col_break_address",
"shipping_address",
"shipping_address_display",
"billing_address",
"billing_address_display",
"tab_additional_costs",
"distribute_additional_costs_based_on",
"additional_costs",
"total_additional_costs",
"tab_other_info",
"more_info", "more_info",
"status",
"column_break_39",
"per_returned",
"section_break_47",
"amended_from", "amended_from",
"range", "range",
"column_break4", "column_break4",
"represents_company", "represents_company",
"order_status_section",
"status",
"column_break_39",
"per_returned",
"subscription_detail", "subscription_detail",
"auto_repeat", "auto_repeat",
"printing_settings", "printing_settings",
@@ -84,7 +85,8 @@
"transporter_name", "transporter_name",
"column_break5", "column_break5",
"lr_no", "lr_no",
"lr_date" "lr_date",
"tab_connections"
], ],
"fields": [ "fields": [
{ {
@@ -112,7 +114,7 @@
"fieldname": "supplier", "fieldname": "supplier",
"fieldtype": "Link", "fieldtype": "Link",
"in_global_search": 1, "in_global_search": 1,
"label": "Supplier", "label": "Job Worker",
"options": "Supplier", "options": "Supplier",
"print_hide": 1, "print_hide": 1,
"print_width": "150px", "print_width": "150px",
@@ -127,7 +129,7 @@
"fieldname": "supplier_name", "fieldname": "supplier_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_global_search": 1, "in_global_search": 1,
"label": "Supplier Name", "label": "Job Worker Name",
"read_only": 1 "read_only": 1
}, },
{ {
@@ -174,15 +176,14 @@
"width": "150px" "width": "150px"
}, },
{ {
"collapsible": 1, "fieldname": "tab_addresses",
"fieldname": "section_addresses", "fieldtype": "Tab Break",
"fieldtype": "Section Break",
"label": "Address and Contact" "label": "Address and Contact"
}, },
{ {
"fieldname": "supplier_address", "fieldname": "supplier_address",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Select Supplier Address", "label": "Select Job Worker Address",
"options": "Address", "options": "Address",
"print_hide": 1 "print_hide": 1
}, },
@@ -269,7 +270,7 @@
{ {
"fieldname": "supplier_warehouse", "fieldname": "supplier_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Supplier Warehouse", "label": "Job Worker Warehouse",
"no_copy": 1, "no_copy": 1,
"options": "Warehouse", "options": "Warehouse",
"print_hide": 1, "print_hide": 1,
@@ -414,6 +415,7 @@
"width": "50%" "width": "50%"
}, },
{ {
"collapsible": 1,
"fieldname": "subscription_detail", "fieldname": "subscription_detail",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Auto Repeat Detail" "label": "Auto Repeat Detail"
@@ -571,10 +573,6 @@
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
}, },
{
"fieldname": "section_break_47",
"fieldtype": "Section Break"
},
{ {
"collapsible": 1, "collapsible": 1,
"fieldname": "accounting_dimensions_section", "fieldname": "accounting_dimensions_section",
@@ -598,11 +596,9 @@
"options": "Project" "options": "Project"
}, },
{ {
"collapsible": 1,
"collapsible_depends_on": "total_additional_costs",
"depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)", "depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
"fieldname": "additional_costs_section", "fieldname": "tab_additional_costs",
"fieldtype": "Section Break", "fieldtype": "Tab Break",
"label": "Additional Costs" "label": "Additional Costs"
}, },
{ {
@@ -658,6 +654,23 @@
{ {
"fieldname": "column_break_uinr", "fieldname": "column_break_uinr",
"fieldtype": "Column Break" "fieldtype": "Column Break"
},
{
"fieldname": "tab_other_info",
"fieldtype": "Tab Break",
"label": "Other Info"
},
{
"collapsible": 1,
"fieldname": "order_status_section",
"fieldtype": "Section Break",
"label": "Order Status"
},
{
"fieldname": "tab_connections",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
} }
], ],
"in_create": 1, "in_create": 1,