fix: include name field and onboarding for print format, report
This commit is contained in:
commit
945084e195
10 changed files with 164 additions and 30 deletions
|
|
@ -6,7 +6,7 @@
|
|||
"idx": 0,
|
||||
"include_name_field": 1,
|
||||
"is_standard": 1,
|
||||
"modified": "2021-11-24 12:35:44.895630",
|
||||
"modified": "2021-11-24 17:25:18.317075",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Doctype",
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
"is_table_field": 0,
|
||||
"label": "Fields",
|
||||
"parent_field": "",
|
||||
"position": "Bottom",
|
||||
"position": "Top",
|
||||
"title": "Fields"
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
"creation": "2021-11-23 12:22:32.922700",
|
||||
"docstatus": 0,
|
||||
"doctype": "Form Tour",
|
||||
"first_document": 0,
|
||||
"idx": 0,
|
||||
"include_name_field": 0,
|
||||
"is_standard": 1,
|
||||
"modified": "2021-11-23 12:28:09.923397",
|
||||
"modified": "2021-11-24 19:15:34.244244",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Custom",
|
||||
"name": "Custom Field",
|
||||
|
|
@ -36,18 +38,6 @@
|
|||
"position": "Right",
|
||||
"title": "Label"
|
||||
},
|
||||
{
|
||||
"description": "Select an appropriate Field Type that suits your requirements",
|
||||
"field": "",
|
||||
"fieldname": "fieldtype",
|
||||
"fieldtype": "Select",
|
||||
"has_next_condition": 0,
|
||||
"is_table_field": 0,
|
||||
"label": "Field Type",
|
||||
"parent_field": "",
|
||||
"position": "Left",
|
||||
"title": "Field Type"
|
||||
},
|
||||
{
|
||||
"description": "Select the label after which you want to insert new field.",
|
||||
"field": "",
|
||||
|
|
@ -60,6 +50,18 @@
|
|||
"position": "Right",
|
||||
"title": "Insert After"
|
||||
},
|
||||
{
|
||||
"description": "Select an appropriate Field Type that suits your requirements",
|
||||
"field": "",
|
||||
"fieldname": "fieldtype",
|
||||
"fieldtype": "Select",
|
||||
"has_next_condition": 0,
|
||||
"is_table_field": 0,
|
||||
"label": "Field Type",
|
||||
"parent_field": "",
|
||||
"position": "Left",
|
||||
"title": "Field Type"
|
||||
},
|
||||
{
|
||||
"description": "Check this to make it a mandatory field",
|
||||
"field": "",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
"documentation_url": "https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext",
|
||||
"idx": 0,
|
||||
"is_complete": 0,
|
||||
"modified": "2021-11-23 15:04:15.826436",
|
||||
"modified": "2021-11-24 17:04:31.523715",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Custom",
|
||||
"name": "Customization",
|
||||
|
|
@ -33,6 +33,9 @@
|
|||
},
|
||||
{
|
||||
"step": "Print Format"
|
||||
},
|
||||
{
|
||||
"step": "Report Builder"
|
||||
}
|
||||
],
|
||||
"subtitle": "Custom Field, Custom Doctype, Naming Series, Role Permission, Workflow, Print Formats, Reports",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"is_complete": 0,
|
||||
"is_single": 0,
|
||||
"is_skipped": 0,
|
||||
"modified": "2021-11-23 13:57:45.091427",
|
||||
"modified": "2021-11-24 15:04:14.662684",
|
||||
"modified_by": "Administrator",
|
||||
"name": "Naming Series",
|
||||
"owner": "Administrator",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"action": "Watch Video",
|
||||
"action_label": "Learn more about Report Builders",
|
||||
"creation": "2021-11-24 17:04:18.762838",
|
||||
"description": "In each module, you will find a host of single-click reports, ranging from financial statements to sales and purchase analytics and stock tracking reports. If a required new report is not available out-of-the-box, you can create custom reports in ERPNext by pulling values from the same multiple ERPNext tables.\n",
|
||||
"docstatus": 0,
|
||||
"doctype": "Onboarding Step",
|
||||
"idx": 0,
|
||||
"is_complete": 0,
|
||||
"is_single": 0,
|
||||
"is_skipped": 0,
|
||||
"modified": "2021-11-24 17:04:18.762838",
|
||||
"modified_by": "Administrator",
|
||||
"name": "Report Builder",
|
||||
"owner": "Administrator",
|
||||
"reference_document": "Report",
|
||||
"show_form_tour": 0,
|
||||
"show_full_form": 0,
|
||||
"title": "Generate Custom Reports",
|
||||
"validate_action": 1,
|
||||
"video_url": "https://youtu.be/TxJGUNarcQs"
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"is_complete": 0,
|
||||
"is_single": 0,
|
||||
"is_skipped": 0,
|
||||
"modified": "2021-11-23 14:00:27.208500",
|
||||
"modified": "2021-11-24 15:04:14.615232",
|
||||
"modified_by": "Administrator",
|
||||
"name": "Role Permissions",
|
||||
"owner": "Administrator",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"is_complete": 0,
|
||||
"is_single": 0,
|
||||
"is_skipped": 0,
|
||||
"modified": "2021-11-23 13:58:58.530044",
|
||||
"modified": "2021-11-24 15:04:14.632144",
|
||||
"modified_by": "Administrator",
|
||||
"name": "Workflows",
|
||||
"owner": "Administrator",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"charts": [],
|
||||
"content": "[{\"type\": \"header\", \"data\": {\"text\": \"Your Shortcuts\", \"level\": 4, \"col\": 12}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Customize Form\", \"col\": 4}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Custom Role\", \"col\": 4}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Client Script\", \"col\": 4}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Server Script\", \"col\": 4}}, {\"type\": \"spacer\", \"data\": {\"col\": 12}}, {\"type\": \"header\", \"data\": {\"text\": \"Reports & Masters\", \"level\": 4, \"col\": 12}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Dashboards\", \"col\": 4}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Form Customization\", \"col\": 4}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Other\", \"col\": 4}}]",
|
||||
"content": "[{\"type\":\"onboarding\",\"data\":{\"onboarding_name\":\"Customization\",\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\",\"level\":4,\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Customize Form\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Custom Role\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Client Script\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Server Script\",\"col\":4}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\",\"level\":4,\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Dashboards\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Form Customization\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Other\",\"col\":4}}]",
|
||||
"creation": "2020-03-02 15:15:03.839594",
|
||||
"docstatus": 0,
|
||||
"doctype": "Workspace",
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
"type": "Link"
|
||||
}
|
||||
],
|
||||
"modified": "2021-08-05 12:15:57.486113",
|
||||
"modified": "2021-11-24 16:20:03.500885",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Custom",
|
||||
"name": "Customization",
|
||||
|
|
|
|||
94
frappe/printing/form_tour/print_format/print_format.json
Normal file
94
frappe/printing/form_tour/print_format/print_format.json
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"creation": "2021-11-24 17:31:44.978996",
|
||||
"docstatus": 0,
|
||||
"doctype": "Form Tour",
|
||||
"first_document": 0,
|
||||
"idx": 0,
|
||||
"include_name_field": 1,
|
||||
"is_standard": 1,
|
||||
"modified": "2021-11-24 17:58:00.807972",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Printing",
|
||||
"name": "Print Format",
|
||||
"owner": "Administrator",
|
||||
"reference_doctype": "Print Format",
|
||||
"save_on_complete": 1,
|
||||
"steps": [
|
||||
{
|
||||
"description": "Select a Doctype for which you want to create a Print Format",
|
||||
"field": "",
|
||||
"fieldname": "doc_type",
|
||||
"fieldtype": "Link",
|
||||
"has_next_condition": 0,
|
||||
"is_table_field": 0,
|
||||
"label": "DocType",
|
||||
"parent_field": "",
|
||||
"position": "Right",
|
||||
"title": "Doctype"
|
||||
},
|
||||
{
|
||||
"description": "You can modify the style of the Print Format from this section",
|
||||
"field": "",
|
||||
"fieldname": "section_break_9",
|
||||
"fieldtype": "Section Break",
|
||||
"has_next_condition": 0,
|
||||
"is_table_field": 0,
|
||||
"label": "Style Settings",
|
||||
"parent_field": "",
|
||||
"position": "Top",
|
||||
"title": "Style Settings"
|
||||
},
|
||||
{
|
||||
"description": "You can add custom css for your Print Format from this section",
|
||||
"field": "",
|
||||
"fieldname": "css",
|
||||
"fieldtype": "Code",
|
||||
"has_next_condition": 0,
|
||||
"is_table_field": 0,
|
||||
"label": "Custom CSS",
|
||||
"parent_field": "",
|
||||
"position": "Top",
|
||||
"title": "Custom CSS"
|
||||
},
|
||||
{
|
||||
"description": "Check this if you want to add custom Jinja Code or JavaScript to your Print Format",
|
||||
"field": "",
|
||||
"fieldname": "custom_format",
|
||||
"fieldtype": "Check",
|
||||
"has_next_condition": 1,
|
||||
"is_table_field": 0,
|
||||
"label": "Custom Format",
|
||||
"next_step_condition": "eval: doc.custom_format",
|
||||
"parent_field": "",
|
||||
"position": "Left",
|
||||
"title": "Custom Format"
|
||||
},
|
||||
{
|
||||
"description": "Select the type of Print Format",
|
||||
"field": "",
|
||||
"fieldname": "print_format_type",
|
||||
"fieldtype": "Select",
|
||||
"has_next_condition": 1,
|
||||
"is_table_field": 0,
|
||||
"label": "Print Format Type",
|
||||
"next_step_condition": "eval: doc.custom_format",
|
||||
"parent_field": "",
|
||||
"position": "Right",
|
||||
"title": "Print Format Type"
|
||||
},
|
||||
{
|
||||
"description": "Enter the code based on the Print Format Type you selected above",
|
||||
"field": "",
|
||||
"fieldname": "html",
|
||||
"fieldtype": "Code",
|
||||
"has_next_condition": 1,
|
||||
"is_table_field": 0,
|
||||
"label": "HTML",
|
||||
"next_step_condition": "eval:doc.html",
|
||||
"parent_field": "",
|
||||
"position": "Right",
|
||||
"title": "Code"
|
||||
}
|
||||
],
|
||||
"title": "Print Format"
|
||||
}
|
||||
|
|
@ -46,10 +46,23 @@ frappe.ui.form.FormTour = class FormTour {
|
|||
if (on_finish) this.on_finish = on_finish;
|
||||
|
||||
this.init_driver();
|
||||
if (this.tour.include_name_field)
|
||||
this.include_name_field();
|
||||
this.build_steps();
|
||||
this.update_driver_steps();
|
||||
}
|
||||
|
||||
include_name_field() {
|
||||
const name_step = {
|
||||
"description": "Enter a name",
|
||||
"fieldname": "__newname",
|
||||
"title": "Name",
|
||||
"position": "right",
|
||||
"is_table_field": 0
|
||||
};
|
||||
this.tour.steps.unshift(name_step);
|
||||
}
|
||||
|
||||
build_steps() {
|
||||
this.driver_steps = [];
|
||||
this.tour.steps.forEach((step) => {
|
||||
|
|
@ -68,7 +81,7 @@ frappe.ui.form.FormTour = class FormTour {
|
|||
|
||||
if (step.fieldtype == 'Table') this.handle_table_step(step);
|
||||
if (step.is_table_field) this.handle_child_table_step(step);
|
||||
//if (step.fieldtype == 'Attach Image') this.handle_attach_image_steps(step);
|
||||
if (step.fieldtype == 'Attach Image') this.handle_attach_image_steps(step);
|
||||
});
|
||||
|
||||
if (this.tour.save_on_complete) {
|
||||
|
|
@ -266,10 +279,8 @@ frappe.ui.form.FormTour = class FormTour {
|
|||
|
||||
handle_attach_image_steps() {
|
||||
$('.btn-attach').one('click', () => {
|
||||
frappe.utils.sleep(300)
|
||||
setTimeout(() => {
|
||||
const modal_element = $(".file-uploader").closest(".modal-content");
|
||||
modal_element.css("z-index", "1000004 !important");
|
||||
const attach_dialog_step = {
|
||||
element: modal_element[0],
|
||||
allowClose: false,
|
||||
|
|
@ -284,12 +295,14 @@ frappe.ui.form.FormTour = class FormTour {
|
|||
|
||||
this.driver_steps.splice(this.driver.currentStep + 1, 0, attach_dialog_step);
|
||||
this.update_driver_steps(); // need to define again, since driver.js only considers steps which are inside DOM
|
||||
frappe.utils.sleep(300).then(() => this.driver.start(this.driver.currentStep + 1));
|
||||
}, 1000);
|
||||
|
||||
modal_element.on('hidden.bs.modal', () => {
|
||||
this.driver.moveNext();
|
||||
})
|
||||
})
|
||||
this.driver.overlay.refresh();
|
||||
|
||||
modal_element.closest('.modal').on('hidden.bs.modal', () => {
|
||||
this.driver.moveNext();
|
||||
});
|
||||
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue