Skip to content

Commit

Permalink
Merge pull request #182 from efeone/design_analysis_fix
Browse files Browse the repository at this point in the history
fix:Modified 'Design Analysis' doctype
  • Loading branch information
muhammadmp authored Nov 10, 2023
2 parents ebb70b3 + dfc905d commit fdd3cb2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 12 deletions.
6 changes: 5 additions & 1 deletion aumms/aumms/doctype/design_analysis/design_analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ frappe.ui.form.on('Design Analysis', {
}
});
},


design_request: function(frm) {
// Clear existing rows in the "Design Details" table
frm.clear_table('design_details');
Expand Down Expand Up @@ -48,6 +50,8 @@ frappe.ui.form.on('Design Analysis', {
});
}
},


refresh: function(frm){
create_custom_buttons(frm);
if(frm.doc.status == 'Approved' && !frm.doc.bom_created){
Expand Down Expand Up @@ -109,7 +113,7 @@ let request_for_verification = function(frm){
}

let request_for_approval = function(frm){
if((frm.doc.status == "Request For Verification" ) || (frm.doc.dr_required_check == 0 && frm.doc.verified_item.length>0 && frm.doc.status != 'Request For Approval' && frm.doc.status != 'Approved')){
if((frm.doc.status == "Request For Verification" ) || (frm.doc.dr_required_check == 0 && frm.doc.verified_item.length>0 && frm.doc.status != 'Request For Approval' && frm.doc.status != 'Approved' && frm.doc.status !='BOM Created')){
frm.add_custom_button('Request For Approval', () =>{
make_request_for_approval(frm);
},'Actions');
Expand Down
48 changes: 37 additions & 11 deletions aumms/aumms/doctype/design_analysis/design_analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"item_group",
"customer_expected_weight",
"purity",
"mobile_no",
"phone_no",
"section_break_rgobr",
"column_break_y3jbr",
"section_break_qqgnh",
Expand All @@ -32,7 +32,11 @@
"section_break_qpifr",
"expected_weight",
"assigned_person",
"bom_created"
"tolerance",
"bom_created",
"reference_tab",
"reference_image",
"image"
],
"fields": [
{
Expand Down Expand Up @@ -97,13 +101,6 @@
"options": "Purity",
"reqd": 1
},
{
"fetch_from": "customer_name.mobile_no",
"fetch_if_empty": 1,
"fieldname": "mobile_no",
"fieldtype": "Data",
"label": "Phone.No"
},
{
"fieldname": "section_break_rgobr",
"fieldtype": "Section Break"
Expand Down Expand Up @@ -179,7 +176,8 @@
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "Draft\nRequest For Verification\nRequest For Approval\nApproved\nHold\nRejected\nBOM Created\nWorkorder Created"
"options": "Draft\nRequest For Verification\nRequest For Approval\nApproved\nHold\nRejected\nBOM Created\nWorkorder Created",
"read_only": 1
},
{
"fieldname": "assigned_person",
Expand All @@ -194,11 +192,39 @@
"fieldtype": "Check",
"hidden": 1,
"label": "BOM created"
},
{
"fieldname": "reference_tab",
"fieldtype": "Tab Break",
"label": "Reference"
},
{
"fetch_from": "design_request.attachment",
"fieldname": "reference_image",
"fieldtype": "Attach Image",
"label": "Reference Image"
},
{
"fieldname": "image",
"fieldtype": "Image",
"label": "image",
"options": "reference_image"
},
{
"fieldname": "tolerance",
"fieldtype": "Float",
"label": "Tolerance"
},
{
"fetch_from": "design_request.mobile_no",
"fieldname": "phone_no",
"fieldtype": "Data",
"label": "Phone No"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-11-07 20:48:24.657689",
"modified": "2023-11-09 14:49:22.769235",
"modified_by": "Administrator",
"module": "AuMMS",
"name": "Design Analysis",
Expand Down

0 comments on commit fdd3cb2

Please sign in to comment.