Skip to content

Commit

Permalink
fix: Fields Modification for Subcontracting DocTypes (#42383)
Browse files Browse the repository at this point in the history
* fix: fields renaming and reordering for enhanced user experience

* fix: dashboard data for stock entry
  • Loading branch information
Ninad1306 committed Jul 25, 2024
1 parent 0e817f4 commit 3023399
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 64 deletions.
9 changes: 8 additions & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"total_amount",
"amended_from",
"credit_note",
"is_return"
"is_return",
"tab_connections"
],
"fields": [
{
Expand Down Expand Up @@ -683,6 +684,12 @@
"label": "Asset Repair",
"options": "Asset Repair",
"read_only": 1
},
{
"fieldname": "tab_connections",
"fieldtype": "Tab Break",
"label": "Connections",
"show_dashboard": 1
}
],
"icon": "fa fa-file-text",
Expand Down
26 changes: 26 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry_dashboard.py
Original file line number Diff line number Diff line change
@@ -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",
],
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@
"cost_center",
"dimension_col_break",
"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",
"column_break_25",
"set_warehouse",
Expand All @@ -48,18 +36,32 @@
"raw_materials_supplied_section",
"set_reserve_warehouse",
"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",
"additional_costs",
"total_additional_costs",
"tab_other_info",
"order_status_section",
"status",
"column_break_39",
"per_received",
"printing_settings_section",
"select_print_heading",
"column_break_43",
"letter_head"
"letter_head",
"tab_connections"
],
"fields": [
{
Expand Down Expand Up @@ -95,7 +97,7 @@
"fieldtype": "Link",
"in_global_search": 1,
"in_standard_filter": 1,
"label": "Supplier",
"label": "Job Worker",
"options": "Supplier",
"print_hide": 1,
"reqd": 1,
Expand All @@ -107,15 +109,15 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"in_global_search": 1,
"label": "Supplier Name",
"label": "Job Worker Name",
"read_only": 1,
"reqd": 1
},
{
"depends_on": "supplier",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"label": "Supplier Warehouse",
"label": "Job Worker Warehouse",
"options": "Warehouse",
"reqd": 1
},
Expand Down Expand Up @@ -166,32 +168,31 @@
"read_only": 1
},
{
"collapsible": 1,
"fieldname": "address_and_contact_section",
"fieldtype": "Section Break",
"fieldname": "tab_address_and_contact",
"fieldtype": "Tab Break",
"label": "Address and Contact"
},
{
"fetch_from": "supplier.supplier_primary_address",
"fetch_if_empty": 1,
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Supplier Address",
"label": "Job Worker Address",
"options": "Address",
"print_hide": 1
},
{
"fieldname": "address_display",
"fieldtype": "Text Editor",
"label": "Supplier Address Details",
"label": "Job Worker Address Details",
"read_only": 1
},
{
"fetch_from": "supplier.supplier_primary_contact",
"fetch_if_empty": 1,
"fieldname": "contact_person",
"fieldtype": "Link",
"label": "Supplier Contact",
"label": "Job Worker Contact",
"options": "Contact",
"print_hide": 1
},
Expand Down Expand Up @@ -337,11 +338,9 @@
"read_only": 1
},
{
"collapsible": 1,
"collapsible_depends_on": "total_additional_costs",
"depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
"fieldname": "additional_costs_section",
"fieldtype": "Section Break",
"fieldname": "tab_additional_costs",
"fieldtype": "Tab Break",
"label": "Additional Costs"
},
{
Expand Down Expand Up @@ -449,6 +448,17 @@
"fieldtype": "Link",
"label": "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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@
"cost_center",
"dimension_col_break",
"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",
"set_warehouse",
"rejected_warehouse",
Expand All @@ -53,23 +41,36 @@
"get_current_stock",
"raw_material_details",
"supplied_items",
"additional_costs_section",
"distribute_additional_costs_based_on",
"additional_costs",
"total_additional_costs",
"section_break_46",
"in_words",
"bill_no",
"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",
"status",
"column_break_39",
"per_returned",
"section_break_47",
"amended_from",
"range",
"column_break4",
"represents_company",
"order_status_section",
"status",
"column_break_39",
"per_returned",
"subscription_detail",
"auto_repeat",
"printing_settings",
Expand All @@ -84,7 +85,8 @@
"transporter_name",
"column_break5",
"lr_no",
"lr_date"
"lr_date",
"tab_connections"
],
"fields": [
{
Expand Down Expand Up @@ -112,7 +114,7 @@
"fieldname": "supplier",
"fieldtype": "Link",
"in_global_search": 1,
"label": "Supplier",
"label": "Job Worker",
"options": "Supplier",
"print_hide": 1,
"print_width": "150px",
Expand All @@ -127,7 +129,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"in_global_search": 1,
"label": "Supplier Name",
"label": "Job Worker Name",
"read_only": 1
},
{
Expand Down Expand Up @@ -174,15 +176,14 @@
"width": "150px"
},
{
"collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
"fieldname": "tab_addresses",
"fieldtype": "Tab Break",
"label": "Address and Contact"
},
{
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Select Supplier Address",
"label": "Select Job Worker Address",
"options": "Address",
"print_hide": 1
},
Expand Down Expand Up @@ -269,7 +270,7 @@
{
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"label": "Supplier Warehouse",
"label": "Job Worker Warehouse",
"no_copy": 1,
"options": "Warehouse",
"print_hide": 1,
Expand Down Expand Up @@ -414,6 +415,7 @@
"width": "50%"
},
{
"collapsible": 1,
"fieldname": "subscription_detail",
"fieldtype": "Section Break",
"label": "Auto Repeat Detail"
Expand Down Expand Up @@ -571,10 +573,6 @@
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "section_break_47",
"fieldtype": "Section Break"
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
Expand All @@ -598,11 +596,9 @@
"options": "Project"
},
{
"collapsible": 1,
"collapsible_depends_on": "total_additional_costs",
"depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
"fieldname": "additional_costs_section",
"fieldtype": "Section Break",
"fieldname": "tab_additional_costs",
"fieldtype": "Tab Break",
"label": "Additional Costs"
},
{
Expand Down Expand Up @@ -658,6 +654,23 @@
{
"fieldname": "column_break_uinr",
"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,
Expand Down

0 comments on commit 3023399

Please sign in to comment.