Browse Source

Publish update

version2
venkata akhil 11 months ago
parent
commit
7da8abfae9
  1. 58
      smart_service/transactions/doctype/publish/publish.js
  2. 4
      smart_service/transactions/doctype/publish/publish.json
  3. 491
      smart_service/transactions/doctype/publish/publish.py

58
smart_service/transactions/doctype/publish/publish.js

@ -962,10 +962,12 @@ frappe.ui.form.on("Publish", {
cur_frm.refresh_field("feature_finder_publish_docs", 'read_only', 1);
}
});
if (added) { frappe.msgprint(__(added + " Doc(s) Added"));
if (added) {
frappe.msgprint(__(added + " Doc(s) Added"));
cur_frm.set_df_property('feature_finder_publish', 'read_only', 1)
cur_frm.set_df_property("feature_finder_publish_docs", 'read_only', 1);
cur_frm.refresh_field("feature_finder_publish"); }
cur_frm.refresh_field("feature_finder_publish");
}
else if (added == 0) { frappe.msgprint(__("No Doc Added")); }
});
@ -1009,10 +1011,12 @@ frappe.ui.form.on("Publish", {
// cur_frm.refresh_field("torque_manual_publish_docs",'read_only',1);
}
});
if (added) { frappe.msgprint(__(added + " Doc(s) Added"));
if (added) {
frappe.msgprint(__(added + " Doc(s) Added"));
cur_frm.set_df_property('torque_manual_publish', 'read_only', 1)
cur_frm.set_df_property("torque_manual_publish_docs", 'read_only', 1);
cur_frm.refresh_field("torque_manual_publish"); }
cur_frm.refresh_field("torque_manual_publish");
}
else if (added == 0) { frappe.msgprint(__("No Doc Added")); }
});
@ -1195,31 +1199,31 @@ frappe.ui.form.on("Publish", {
refresh_field("publish_documents");
frappe.msgprint(__(frm.doc.variant_mapping + " Added"));
}
if(frm.doc.feature_finder_publish_docs && frm.doc.publish_module=='Feature Finder'){
frm.doc.publish_documents.forEach(publishrow => {
if (frm.doc.variant_mapping == publishrow.variant_mapping) {
dulicate = true;
}
});
frappe.msgprint("Variant Mapping already added");
// if(frm.doc.feature_finder_publish_docs && frm.doc.publish_module=='Feature Finder'){
// frm.doc.publish_documents.forEach(publishrow => {
// if (frm.doc.variant_mapping == publishrow.variant_mapping) {
// dulicate = true;
// }
// });
// frappe.msgprint("Variant Mapping already added");
}
if(frm.doc.torque_manual_publish_docs && frm.doc.publish_module=='Torque Manual'){
frm.doc.publish_documents.forEach(publishrow => {
if (frm.doc.variant_mapping == publishrow.variant_mapping) {
dulicate = true;
}
});
frappe.msgprint("Variant Mapping already added");
// }
// if(frm.doc.torque_manual_publish_docs && frm.doc.publish_module=='Torque Manual'){
// frm.doc.publish_documents.forEach(publishrow => {
// if (frm.doc.variant_mapping == publishrow.variant_mapping) {
// dulicate = true;
// }
// });
// frappe.msgprint("Variant Mapping already added");
}
if (dulicate === false && frm.doc.publish_module == "Torque Manual") {
let child = cur_frm.add_child("publish_documents");
child.variant_mapping = frm.doc.variant_mapping;
child.item_category = "Variant Mapping";
refresh_field("publish_documents");
frappe.msgprint(__(frm.doc.variant_mapping + " Added"));
}
// }
// if (dulicate === false && frm.doc.publish_module == "Torque Manual") {
// let child = cur_frm.add_child("publish_documents");
// child.variant_mapping = frm.doc.variant_mapping;
// child.item_category = "Variant Mapping";
// refresh_field("publish_documents");
// frappe.msgprint(__(frm.doc.variant_mapping + " Added"));
// }
},
km_report: function (frm, cdt, cdn) {
if (frm.doc.publish_module == "Automotive System") {

4
smart_service/transactions/doctype/publish/publish.json

@ -209,7 +209,7 @@
"read_only": 1
},
{
"depends_on": "eval:doc.variant_mapping && doc.publish_type == \"Internal\" && doc.docstatus == 0 && doc.publish_module=='Automotive System' || doc.publish_module=='Torque Manual'",
"depends_on": "eval:doc.variant_mapping && doc.publish_type == \"Internal\" && doc.docstatus == 0 && doc.publish_module=='Automotive System'",
"fieldname": "add_variant_mapping_to_publish",
"fieldtype": "Button",
"label": "Add Variant Mapping to Publish",
@ -440,7 +440,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-12-12 23:25:19.477106",
"modified": "2023-12-15 18:57:55.788156",
"modified_by": "Administrator",
"module": "Transactions",
"name": "Publish",

491
smart_service/transactions/doctype/publish/publish.py

File diff suppressed because it is too large
Loading…
Cancel
Save