From 99361b4a9eb88b56b90474fe42ccd2ba4f081afb Mon Sep 17 00:00:00 2001 From: jbienesdev Date: Mon, 23 Nov 2020 09:03:13 +0000 Subject: [PATCH] chore: remove notification details section --- erpnext/stock/doctype/shipment/shipment.js | 72 -------------------- erpnext/stock/doctype/shipment/shipment.json | 56 +-------------- 2 files changed, 1 insertion(+), 127 deletions(-) diff --git a/erpnext/stock/doctype/shipment/shipment.js b/erpnext/stock/doctype/shipment/shipment.js index 62070e4e55..2832c8c72a 100644 --- a/erpnext/stock/doctype/shipment/shipment.js +++ b/erpnext/stock/doctype/shipment/shipment.js @@ -102,8 +102,6 @@ frappe.ui.form.on('Shipment', { frm.set_value("pickup_customer", ''); frm.set_value("pickup_company", ''); } - frm.events.remove_notific_child_table(frm, 'shipment_notification_subscription', 'Pickup'); - frm.events.remove_notific_child_table(frm, 'shipment_status_update_subscription', 'Pickup'); }, delivery_to_type: function(frm) { if (frm.doc.delivery_to_type == 'Company') { @@ -126,8 +124,6 @@ frappe.ui.form.on('Shipment', { else { frm.toggle_display("shipment_delivery_note", true); } - frm.events.remove_notific_child_table(frm, 'shipment_notification_subscription', 'Delivery'); - frm.events.remove_notific_child_table(frm, 'shipment_status_update_subscription', 'Delivery'); }, delivery_address_name: function(frm) { if (frm.doc.delivery_to_type == 'Company') { @@ -427,80 +423,12 @@ frappe.ui.form.on('Shipment', { frm.set_value(field, ''); } }, - pickup_from_send_shipping_notification: function(frm, cdt, cdn) { - if (frm.doc.pickup_contact_email && frm.doc.pickup_from_send_shipping_notification - && !validate_duplicate(frm, 'shipment_notification_subscription', frm.doc.pickup_contact_email, locals[cdt][cdn].idx)) { - let row = frappe.model.add_child(frm.doc, "Shipment Notification Subscription", "shipment_notification_subscription"); - row.email = frm.doc.pickup_contact_email; - frm.refresh_fields("shipment_notification_subscription"); - } - if (!frm.doc.pickup_from_send_shipping_notification) { - frm.events.remove_email_row(frm, 'shipment_notification_subscription', frm.doc.pickup_contact_email); - frm.refresh_fields("shipment_notification_subscription"); - } - }, - pickup_from_subscribe_to_status_updates: function(frm, cdt, cdn) { - if (frm.doc.pickup_contact_email && frm.doc.pickup_from_subscribe_to_status_updates - && !validate_duplicate(frm, 'shipment_status_update_subscription', frm.doc.pickup_contact_email, locals[cdt][cdn].idx)) { - let row = frappe.model.add_child(frm.doc, "Shipment Status Update Subscription", "shipment_status_update_subscription"); - row.email = frm.doc.pickup_contact_email; - frm.refresh_fields("shipment_status_update_subscription"); - } - if (!frm.doc.pickup_from_subscribe_to_status_updates) { - frm.events.remove_email_row(frm, 'shipment_status_update_subscription', frm.doc.pickup_contact_email); - frm.refresh_fields("shipment_status_update_subscription"); - } - }, - delivery_to_send_shipping_notification: function(frm, cdt, cdn) { - if (frm.doc.delivery_contact_email && frm.doc.delivery_to_send_shipping_notification - && !validate_duplicate(frm, 'shipment_notification_subscription', frm.doc.delivery_contact_email, locals[cdt][cdn].idx)){ - let row = frappe.model.add_child(frm.doc, "Shipment Notification Subscription", "shipment_notification_subscription"); - row.email = frm.doc.delivery_contact_email; - frm.refresh_fields("shipment_notification_subscription"); - } - if (!frm.doc.delivery_to_send_shipping_notification) { - frm.events.remove_email_row(frm, 'shipment_notification_subscription', frm.doc.delivery_contact_email); - frm.refresh_fields("shipment_notification_subscription"); - } - }, - delivery_to_subscribe_to_status_updates: function(frm, cdt, cdn) { - if (frm.doc.delivery_contact_email && frm.doc.delivery_to_subscribe_to_status_updates - && !validate_duplicate(frm, 'shipment_status_update_subscription', frm.doc.delivery_contact_email, locals[cdt][cdn].idx)) { - let row = frappe.model.add_child(frm.doc, "Shipment Status Update Subscription", "shipment_status_update_subscription"); - row.email = frm.doc.delivery_contact_email; - frm.refresh_fields("shipment_status_update_subscription"); - } - if (!frm.doc.delivery_to_subscribe_to_status_updates) { - frm.events.remove_email_row(frm, 'shipment_status_update_subscription', frm.doc.delivery_contact_email); - frm.refresh_fields("shipment_status_update_subscription"); - } - }, remove_email_row: function(frm, table, fieldname) { $.each(frm.doc[table] || [], function(i, detail) { if(detail.email === fieldname){ cur_frm.get_field(table).grid.grid_rows[i].remove(); } }); - }, - remove_notific_child_table: function(frm, table, delivery_type) { - $.each(frm.doc[table] || [], function(i, detail) { - if (detail.email != frm.doc.pickup_email || detail.email != frm.doc.delivery_email){ - cur_frm.get_field(table).grid.grid_rows[i].remove(); - } - }); - frm.refresh_fields(table); - if (delivery_type == 'Delivery') { - frm.set_value("delivery_to_send_shipping_notification", 0); - frm.set_value("delivery_to_subscribe_to_status_updates", 0); - frm.refresh_fields("delivery_to_send_shipping_notification"); - frm.refresh_fields("delivery_to_subscribe_to_status_updates"); - } - else { - frm.set_value("pickup_from_send_shipping_notification", 0); - frm.set_value("pickup_from_subscribe_to_status_updates", 0); - frm.refresh_fields("pickup_from_send_shipping_notification"); - frm.refresh_fields("pickup_from_subscribe_to_status_updates"); - } } }); diff --git a/erpnext/stock/doctype/shipment/shipment.json b/erpnext/stock/doctype/shipment/shipment.json index 7e2c5baace..1ae7862bc9 100644 --- a/erpnext/stock/doctype/shipment/shipment.json +++ b/erpnext/stock/doctype/shipment/shipment.json @@ -30,14 +30,6 @@ "delivery_contact_name", "delivery_contact_email", "delivery_contact", - "notification_details_section", - "pickup_from_send_shipping_notification", - "pickup_from_subscribe_to_status_updates", - "shipment_notification_subscription", - "column_break_27", - "delivery_to_send_shipping_notification", - "delivery_to_subscribe_to_status_updates", - "shipment_status_update_subscription", "parcels_section", "shipment_parcel", "parcel_template", @@ -224,40 +216,6 @@ "fieldtype": "Small Text", "read_only": 1 }, - { - "collapsible": 1, - "fieldname": "notification_details_section", - "fieldtype": "Section Break", - "label": "Notification Details" - }, - { - "default": "0", - "fieldname": "pickup_from_send_shipping_notification", - "fieldtype": "Check", - "label": "Send shipping notification" - }, - { - "default": "0", - "fieldname": "pickup_from_subscribe_to_status_updates", - "fieldtype": "Check", - "label": "Subscribe to status updates" - }, - { - "fieldname": "column_break_27", - "fieldtype": "Column Break" - }, - { - "default": "0", - "fieldname": "delivery_to_send_shipping_notification", - "fieldtype": "Check", - "label": "Send shipping notification" - }, - { - "default": "0", - "fieldname": "delivery_to_subscribe_to_status_updates", - "fieldtype": "Check", - "label": "Subscribe to status updates" - }, { "fieldname": "parcels_section", "fieldtype": "Section Break", @@ -437,18 +395,6 @@ "label": "Shipment Delivery Note", "options": "Shipment Delivery Note" }, - { - "fieldname": "shipment_notification_subscription", - "fieldtype": "Table", - "label": "Shipment Notification Subscription", - "options": "Shipment Notification Subscription" - }, - { - "fieldname": "shipment_status_update_subscription", - "fieldtype": "Table", - "label": "Shipment Status Update Subscription", - "options": "Shipment Status Update Subscription" - }, { "depends_on": "eval:doc.pickup_from_type === 'Company'", "fieldname": "pickup_contact_person", @@ -460,7 +406,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2020-11-23 16:26:28.132608", + "modified": "2020-11-23 17:00:51.600965", "modified_by": "Administrator", "module": "Stock", "name": "Shipment",