From d231b19b9fd701b18cd9aaa0fcae6fbd87394544 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 18:42:07 +0530 Subject: [PATCH] fix: stock onboarding (backport #35453) (#35480) * fix: stock settings tour - remove dead fields - Keep only essential fields in tour (cherry picked from commit 2e13fbab5e15a8b29eaff86f6d4b7987114d31c9) # Conflicts: # erpnext/stock/doctype/stock_settings/stock_settings.json * fix: hide ledger button on new warehouse (cherry picked from commit 7a18db561fd0dd83c775fcfecdd8dbd28e25f0c1) * fix: warehouse form cleanup - organize fields - group transit fields and move them lower - enable/disable should be button - hide pointless fields from listview (cherry picked from commit 40ce33dff18cb4d63a4211c68c87cb12ebcad3d6) * fix: disable/enable with button (cherry picked from commit 81e901ba627e49e9e93a2f8b5be09a0c5d6e8112) * fix: warehouse tour - remove warehouse type, it doesn't do what it says. Misleading. (cherry picked from commit aa9f926298233ff5dfa2aff8fd3eaeb226264220) * fix: filter parent warehouses by company (cherry picked from commit 3341cd6b80e28c60225b4f7edb77e8b9ca7d1437) * fix: reorder stock reco tour (cherry picked from commit dd245ccc7fd24d60f52c19488789761f14eb4b6a) * fix: replace stock projected with ledger Ledger is much more widely used report, better to show that first? (cherry picked from commit 8fe8f800336c9e7702dd6c8d60d28b0bcc7a86c5) * chore: docs for stock settings [skip ci] (cherry picked from commit 964bb1d9483c43d1054f108b17daf94c0ce20ee3) # Conflicts: # erpnext/stock/doctype/stock_settings/stock_settings.json * chore: conflicts --------- Co-authored-by: Ankush Menat --- .../stock_settings/stock_settings.json | 7 +- erpnext/stock/doctype/warehouse/warehouse.js | 39 +++++---- .../stock/doctype/warehouse/warehouse.json | 30 ++++--- .../stock_reconciliation.json | 63 ++++++++++----- .../stock_settings/stock_settings.json | 79 ++++++++----------- .../stock/form_tour/warehouse/warehouse.json | 44 ++++++----- .../stock/module_onboarding/stock/stock.json | 6 +- .../check_stock_ledger_report.json | 24 ++++++ .../create_a_stock_entry.json | 2 +- .../create_a_warehouse.json | 2 +- .../stock_opening_balance.json | 2 +- .../stock_settings/stock_settings.json | 2 +- 12 files changed, 177 insertions(+), 123 deletions(-) create mode 100644 erpnext/stock/onboarding_step/check_stock_ledger_report/check_stock_ledger_report.json diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.json b/erpnext/stock/doctype/stock_settings/stock_settings.json index ec7fb0f4a28..cb2bc0a7f51 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.json +++ b/erpnext/stock/doctype/stock_settings/stock_settings.json @@ -8,12 +8,12 @@ "defaults_tab", "item_defaults_section", "item_naming_by", + "valuation_method", "item_group", - "stock_uom", "column_break_4", "default_warehouse", "sample_retention_warehouse", - "valuation_method", + "stock_uom", "price_list_defaults_section", "auto_insert_price_list_rate_if_missing", "column_break_12", @@ -96,6 +96,7 @@ "fieldtype": "Column Break" }, { + "documentation_url": "https://docs.erpnext.com/docs/v14/user/manual/en/stock/articles/calculation-of-valuation-rate-in-fifo-and-moving-average", "fieldname": "valuation_method", "fieldtype": "Select", "label": "Default Valuation Method", @@ -346,7 +347,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2022-02-05 15:33:43.692736", + "modified": "2023-05-29 15:09:54.959411", "modified_by": "Administrator", "module": "Stock", "name": "Stock Settings", diff --git a/erpnext/stock/doctype/warehouse/warehouse.js b/erpnext/stock/doctype/warehouse/warehouse.js index d69c624fba3..87a23efc590 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.js +++ b/erpnext/stock/doctype/warehouse/warehouse.js @@ -17,6 +17,7 @@ frappe.ui.form.on("Warehouse", { return { filters: { is_group: 1, + company: doc.company, }, }; }); @@ -39,26 +40,34 @@ frappe.ui.form.on("Warehouse", { !frm.doc.__islocal ); - if (!frm.doc.__islocal) { + if (!frm.is_new()) { frappe.contacts.render_address_and_contact(frm); + + let enable_toggle = frm.doc.disabled ? "Enable" : "Disable"; + frm.add_custom_button(__(enable_toggle), () => { + frm.set_value('disabled', 1 - frm.doc.disabled); + frm.save() + }); + + frm.add_custom_button(__("Stock Balance"), function () { + frappe.set_route("query-report", "Stock Balance", { + warehouse: frm.doc.name, + }); + }); + + frm.add_custom_button( + frm.doc.is_group + ? __("Convert to Ledger", null, "Warehouse") + : __("Convert to Group", null, "Warehouse"), + function () { + convert_to_group_or_ledger(frm); + }, + ); + } else { frappe.contacts.clear_address_and_contact(frm); } - frm.add_custom_button(__("Stock Balance"), function () { - frappe.set_route("query-report", "Stock Balance", { - warehouse: frm.doc.name, - }); - }); - - frm.add_custom_button( - frm.doc.is_group - ? __("Convert to Ledger", null, "Warehouse") - : __("Convert to Group", null, "Warehouse"), - function () { - convert_to_group_or_ledger(frm); - }, - ); if (!frm.doc.is_group && frm.doc.__onload && frm.doc.__onload.account) { frm.add_custom_button( diff --git a/erpnext/stock/doctype/warehouse/warehouse.json b/erpnext/stock/doctype/warehouse/warehouse.json index c695d541bf9..43b2ad2a69b 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.json +++ b/erpnext/stock/doctype/warehouse/warehouse.json @@ -1,23 +1,21 @@ { "actions": [], "allow_import": 1, - "creation": "2013-03-07 18:50:32", + "creation": "2023-05-29 13:02:17.121296", "description": "A logical Warehouse against which stock entries are made.", "doctype": "DocType", "document_type": "Setup", "engine": "InnoDB", "field_order": [ "warehouse_detail", + "disabled", "warehouse_name", "column_break_3", - "warehouse_type", - "parent_warehouse", - "default_in_transit_warehouse", "is_group", + "parent_warehouse", "column_break_4", "account", "company", - "disabled", "address_and_contact", "address_html", "column_break_10", @@ -32,6 +30,10 @@ "city", "state", "pin", + "transit_section", + "warehouse_type", + "column_break_qajx", + "default_in_transit_warehouse", "tree_details", "lft", "rgt", @@ -58,7 +60,7 @@ "fieldname": "is_group", "fieldtype": "Check", "in_list_view": 1, - "label": "Is Group" + "label": "Is Group Warehouse" }, { "fieldname": "company", @@ -78,7 +80,7 @@ "default": "0", "fieldname": "disabled", "fieldtype": "Check", - "in_list_view": 1, + "hidden": 1, "label": "Disabled" }, { @@ -164,7 +166,6 @@ { "fieldname": "city", "fieldtype": "Data", - "in_list_view": 1, "label": "City", "oldfieldname": "city", "oldfieldtype": "Data" @@ -238,13 +239,23 @@ "fieldtype": "Link", "label": "Default In-Transit Warehouse", "options": "Warehouse" + }, + { + "collapsible": 1, + "fieldname": "transit_section", + "fieldtype": "Section Break", + "label": "Transit" + }, + { + "fieldname": "column_break_qajx", + "fieldtype": "Column Break" } ], "icon": "fa fa-building", "idx": 1, "is_tree": 1, "links": [], - "modified": "2022-03-01 02:37:48.034944", + "modified": "2023-05-29 13:10:43.333160", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse", @@ -261,7 +272,6 @@ "read": 1, "report": 1, "role": "Item Manager", - "set_user_permissions": 1, "share": 1, "write": 1 }, diff --git a/erpnext/stock/form_tour/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/form_tour/stock_reconciliation/stock_reconciliation.json index 5b7fd72c082..07a511071f8 100644 --- a/erpnext/stock/form_tour/stock_reconciliation/stock_reconciliation.json +++ b/erpnext/stock/form_tour/stock_reconciliation/stock_reconciliation.json @@ -2,54 +2,75 @@ "creation": "2021-08-24 14:44:46.770952", "docstatus": 0, "doctype": "Form Tour", + "first_document": 0, "idx": 0, + "include_name_field": 0, "is_standard": 1, - "modified": "2021-08-25 16:26:11.718664", + "list_name": "List", + "modified": "2023-05-29 13:38:27.192177", "modified_by": "Administrator", "module": "Stock", "name": "Stock Reconciliation", + "new_document_form": 0, "owner": "Administrator", "reference_doctype": "Stock Reconciliation", "save_on_complete": 1, "steps": [ { "description": "Set Purpose to Opening Stock to set the stock opening balance.", - "field": "", "fieldname": "purpose", "fieldtype": "Select", "has_next_condition": 1, + "hide_buttons": 0, "is_table_field": 0, "label": "Purpose", + "modal_trigger": 0, + "next_on_click": 0, "next_step_condition": "eval: doc.purpose === \"Opening Stock\"", - "parent_field": "", + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Top", - "title": "Purpose" - }, - { - "description": "Select the items for which the opening stock has to be set.", - "field": "", - "fieldname": "items", - "fieldtype": "Table", - "has_next_condition": 1, - "is_table_field": 0, - "label": "Items", - "next_step_condition": "eval: doc.items[0]?.item_code", - "parent_field": "", - "position": "Top", - "title": "Items" + "title": "Purpose", + "ui_tour": 0 }, { "description": "Edit the Posting Date by clicking on the Edit Posting Date and Time checkbox below.", - "field": "", "fieldname": "posting_date", "fieldtype": "Date", "has_next_condition": 0, + "hide_buttons": 0, "is_table_field": 0, "label": "Posting Date", - "parent_field": "", + "modal_trigger": 0, + "next_on_click": 0, + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Bottom", - "title": "Posting Date" + "title": "Posting Date", + "ui_tour": 0 + }, + { + "description": "Select the items for which the opening stock has to be set.", + "fieldname": "items", + "fieldtype": "Table", + "has_next_condition": 1, + "hide_buttons": 0, + "is_table_field": 0, + "label": "Items", + "modal_trigger": 0, + "next_on_click": 0, + "next_step_condition": "eval: doc.items[0]?.item_code", + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, + "position": "Top", + "title": "Items", + "ui_tour": 0 } ], - "title": "Stock Reconciliation" + "title": "Stock Reconciliation", + "track_steps": 0, + "ui_tour": 0 } \ No newline at end of file diff --git a/erpnext/stock/form_tour/stock_settings/stock_settings.json b/erpnext/stock/form_tour/stock_settings/stock_settings.json index 3d164e33b3b..adbd1597f39 100644 --- a/erpnext/stock/form_tour/stock_settings/stock_settings.json +++ b/erpnext/stock/form_tour/stock_settings/stock_settings.json @@ -2,88 +2,73 @@ "creation": "2021-08-20 15:20:59.336585", "docstatus": 0, "doctype": "Form Tour", + "first_document": 0, "idx": 0, + "include_name_field": 0, "is_standard": 1, - "modified": "2021-08-25 16:19:37.699528", + "list_name": "List", + "modified": "2023-05-29 12:33:19.142202", "modified_by": "Administrator", "module": "Stock", "name": "Stock Settings", + "new_document_form": 0, "owner": "Administrator", "reference_doctype": "Stock Settings", "save_on_complete": 1, "steps": [ { "description": "By default, the Item Name is set as per the Item Code entered. If you want Items to be named by a Naming Series choose the 'Naming Series' option.", - "field": "", "fieldname": "item_naming_by", "fieldtype": "Select", "has_next_condition": 0, + "hide_buttons": 0, "is_table_field": 0, "label": "Item Naming By", - "parent_field": "", + "modal_trigger": 0, + "next_on_click": 0, + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Bottom", - "title": "Item Naming By" + "title": "Item Naming By", + "ui_tour": 0 }, { "description": "Set a Default Warehouse for Inventory Transactions. This will be fetched into the Default Warehouse in the Item master.", - "field": "", "fieldname": "default_warehouse", "fieldtype": "Link", "has_next_condition": 0, + "hide_buttons": 0, "is_table_field": 0, "label": "Default Warehouse", - "parent_field": "", + "modal_trigger": 0, + "next_on_click": 0, + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Bottom", - "title": "Default Warehouse" - }, - { - "description": "Quality inspection is performed on the inward and outward movement of goods. Receipt and delivery transactions will be stopped or the user will be warned if the quality inspection is not performed.", - "field": "", - "fieldname": "action_if_quality_inspection_is_not_submitted", - "fieldtype": "Select", - "has_next_condition": 0, - "is_table_field": 0, - "label": "Action If Quality Inspection Is Not Submitted", - "parent_field": "", - "position": "Bottom", - "title": "Action if Quality Inspection Is Not Submitted" - }, - { - "description": "Serial numbers for stock will be set automatically based on the Items entered based on first in first out in transactions like Purchase/Sales Invoices, Delivery Notes, etc.", - "field": "", - "fieldname": "automatically_set_serial_nos_based_on_fifo", - "fieldtype": "Check", - "has_next_condition": 0, - "is_table_field": 0, - "label": "Automatically Set Serial Nos Based on FIFO", - "parent_field": "", - "position": "Bottom", - "title": "Automatically Set Serial Nos based on FIFO" - }, - { - "description": "Show 'Scan Barcode' field above every child table to insert Items with ease.", - "field": "", - "fieldname": "show_barcode_field", - "fieldtype": "Check", - "has_next_condition": 0, - "is_table_field": 0, - "label": "Show Barcode Field in Stock Transactions", - "parent_field": "", - "position": "Bottom", - "title": "Show Barcode Field" + "title": "Default Warehouse", + "ui_tour": 0 }, { "description": "Choose between FIFO and Moving Average Valuation Methods. Click here to know more about them.", - "field": "", "fieldname": "valuation_method", "fieldtype": "Select", "has_next_condition": 0, + "hide_buttons": 0, "is_table_field": 0, "label": "Default Valuation Method", - "parent_field": "", + "modal_trigger": 0, + "next_on_click": 0, + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Bottom", - "title": "Default Valuation Method" + "title": "Default Valuation Method", + "ui_tour": 0 } ], - "title": "Stock Settings" + "title": "Stock Settings", + "track_steps": 0, + "ui_tour": 0 } \ No newline at end of file diff --git a/erpnext/stock/form_tour/warehouse/warehouse.json b/erpnext/stock/form_tour/warehouse/warehouse.json index 23ff2aebbaa..5897357bc73 100644 --- a/erpnext/stock/form_tour/warehouse/warehouse.json +++ b/erpnext/stock/form_tour/warehouse/warehouse.json @@ -2,53 +2,57 @@ "creation": "2021-08-24 14:43:44.465237", "docstatus": 0, "doctype": "Form Tour", + "first_document": 0, "idx": 0, + "include_name_field": 0, "is_standard": 1, - "modified": "2021-08-24 14:50:31.988256", + "list_name": "List", + "modified": "2023-05-29 13:09:49.920796", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse", + "new_document_form": 0, "owner": "Administrator", "reference_doctype": "Warehouse", "save_on_complete": 1, "steps": [ { "description": "Select a name for the warehouse. This should reflect its location or purpose.", - "field": "", "fieldname": "warehouse_name", "fieldtype": "Data", "has_next_condition": 1, + "hide_buttons": 0, "is_table_field": 0, "label": "Warehouse Name", + "modal_trigger": 0, + "next_on_click": 0, "next_step_condition": "eval: doc.warehouse_name", - "parent_field": "", + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Bottom", - "title": "Warehouse Name" - }, - { - "description": "Select a warehouse type to categorize the warehouse into a sub-group.", - "field": "", - "fieldname": "warehouse_type", - "fieldtype": "Link", - "has_next_condition": 0, - "is_table_field": 0, - "label": "Warehouse Type", - "parent_field": "", - "position": "Top", - "title": "Warehouse Type" + "title": "Warehouse Name", + "ui_tour": 0 }, { "description": "Select an account to set a default account for all transactions with this warehouse.", - "field": "", "fieldname": "account", "fieldtype": "Link", "has_next_condition": 0, + "hide_buttons": 0, "is_table_field": 0, "label": "Account", - "parent_field": "", + "modal_trigger": 0, + "next_on_click": 0, + "offset_x": 0, + "offset_y": 0, + "popover_element": 0, "position": "Top", - "title": "Account" + "title": "Account", + "ui_tour": 0 } ], - "title": "Warehouse" + "title": "Warehouse", + "track_steps": 0, + "ui_tour": 0 } \ No newline at end of file diff --git a/erpnext/stock/module_onboarding/stock/stock.json b/erpnext/stock/module_onboarding/stock/stock.json index c246747a5b3..864ac4be3b4 100644 --- a/erpnext/stock/module_onboarding/stock/stock.json +++ b/erpnext/stock/module_onboarding/stock/stock.json @@ -19,7 +19,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/stock", "idx": 0, "is_complete": 0, - "modified": "2021-08-20 14:38:55.570067", + "modified": "2023-05-29 14:43:36.223302", "modified_by": "Administrator", "module": "Stock", "name": "Stock", @@ -35,10 +35,10 @@ "step": "Create a Stock Entry" }, { - "step": "Stock Opening Balance" + "step": "Check Stock Ledger Report" }, { - "step": "View Stock Projected Qty" + "step": "Stock Opening Balance" } ], "subtitle": "Inventory, Warehouses, Analysis, and more.", diff --git a/erpnext/stock/onboarding_step/check_stock_ledger_report/check_stock_ledger_report.json b/erpnext/stock/onboarding_step/check_stock_ledger_report/check_stock_ledger_report.json new file mode 100644 index 00000000000..cdbc0b759ba --- /dev/null +++ b/erpnext/stock/onboarding_step/check_stock_ledger_report/check_stock_ledger_report.json @@ -0,0 +1,24 @@ +{ + "action": "View Report", + "action_label": "Check Stock Ledger", + "creation": "2023-05-29 13:46:04.174565", + "description": "# Check Stock Reports\nBased on the various stock transactions, you can get a host of one-click Stock Reports in ERPNext like Stock Ledger, Stock Balance, Projected Quantity, and Ageing analysis.", + "docstatus": 0, + "doctype": "Onboarding Step", + "idx": 0, + "is_complete": 0, + "is_single": 0, + "is_skipped": 0, + "modified": "2023-05-29 14:39:03.943244", + "modified_by": "Administrator", + "name": "Check Stock Ledger Report", + "owner": "Administrator", + "reference_report": "Stock Ledger", + "report_description": "Stock Ledger report contains every submitted stock transaction. You can use filter to narrow down ledger entries.", + "report_reference_doctype": "Stock Ledger Entry", + "report_type": "Script Report", + "show_form_tour": 0, + "show_full_form": 0, + "title": "Check Stock Ledger", + "validate_action": 1 +} \ No newline at end of file diff --git a/erpnext/stock/onboarding_step/create_a_stock_entry/create_a_stock_entry.json b/erpnext/stock/onboarding_step/create_a_stock_entry/create_a_stock_entry.json index 3cb522c893d..dea2aae9500 100644 --- a/erpnext/stock/onboarding_step/create_a_stock_entry/create_a_stock_entry.json +++ b/erpnext/stock/onboarding_step/create_a_stock_entry/create_a_stock_entry.json @@ -9,7 +9,7 @@ "is_complete": 0, "is_single": 0, "is_skipped": 0, - "modified": "2021-06-18 13:57:11.434063", + "modified": "2023-05-29 14:39:04.066547", "modified_by": "Administrator", "name": "Create a Stock Entry", "owner": "Administrator", diff --git a/erpnext/stock/onboarding_step/create_a_warehouse/create_a_warehouse.json b/erpnext/stock/onboarding_step/create_a_warehouse/create_a_warehouse.json index 22c88bf10ea..25926127a08 100644 --- a/erpnext/stock/onboarding_step/create_a_warehouse/create_a_warehouse.json +++ b/erpnext/stock/onboarding_step/create_a_warehouse/create_a_warehouse.json @@ -9,7 +9,7 @@ "is_complete": 0, "is_single": 0, "is_skipped": 0, - "modified": "2021-08-18 12:23:36.675572", + "modified": "2023-05-29 14:39:04.074907", "modified_by": "Administrator", "name": "Create a Warehouse", "owner": "Administrator", diff --git a/erpnext/stock/onboarding_step/stock_opening_balance/stock_opening_balance.json b/erpnext/stock/onboarding_step/stock_opening_balance/stock_opening_balance.json index 48fd1fddee0..18c95505d72 100644 --- a/erpnext/stock/onboarding_step/stock_opening_balance/stock_opening_balance.json +++ b/erpnext/stock/onboarding_step/stock_opening_balance/stock_opening_balance.json @@ -9,7 +9,7 @@ "is_complete": 0, "is_single": 0, "is_skipped": 0, - "modified": "2021-06-18 13:59:36.021097", + "modified": "2023-05-29 14:39:08.825699", "modified_by": "Administrator", "name": "Stock Opening Balance", "owner": "Administrator", diff --git a/erpnext/stock/onboarding_step/stock_settings/stock_settings.json b/erpnext/stock/onboarding_step/stock_settings/stock_settings.json index 2cf90e806cd..b48ac806a46 100644 --- a/erpnext/stock/onboarding_step/stock_settings/stock_settings.json +++ b/erpnext/stock/onboarding_step/stock_settings/stock_settings.json @@ -9,7 +9,7 @@ "is_complete": 0, "is_single": 1, "is_skipped": 0, - "modified": "2021-08-18 12:06:51.139387", + "modified": "2023-05-29 14:39:04.083360", "modified_by": "Administrator", "name": "Stock Settings", "owner": "Administrator",