-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…31456) refactor: clean up product bundle client side code (#31455) refactor: clean up product bundle cient side code - Remove deprecated CUR_FRM scripts - Remove client side fetches and move it to doctype schema (cherry picked from commit 20dac08) Co-authored-by: Ankush Menat <ankush@frappe.io>
- Loading branch information
1 parent
873d1ec
commit 5e7cad4
Showing
2 changed files
with
17 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors | ||
// License: GNU General Public License v3. See license.txt | ||
|
||
cur_frm.cscript.refresh = function(doc, cdt, cdn) { | ||
cur_frm.toggle_enable('new_item_code', doc.__islocal); | ||
} | ||
|
||
cur_frm.fields_dict.new_item_code.get_query = function() { | ||
return{ | ||
query: "erpnext.selling.doctype.product_bundle.product_bundle.get_new_item_code" | ||
} | ||
} | ||
cur_frm.fields_dict.new_item_code.query_description = __('Please select Item where "Is Stock Item" is "No" and "Is Sales Item" is "Yes" and there is no other Product Bundle'); | ||
|
||
cur_frm.cscript.onload = function() { | ||
// set add fetch for item_code's item_name and description | ||
cur_frm.add_fetch('item_code', 'stock_uom', 'uom'); | ||
cur_frm.add_fetch('item_code', 'description', 'description'); | ||
} | ||
frappe.ui.form.on("Product Bundle", { | ||
refresh: function (frm) { | ||
frm.toggle_enable("new_item_code", frm.is_new()); | ||
frm.set_query("new_item_code", () => { | ||
return { | ||
query: "erpnext.selling.doctype.product_bundle.product_bundle.get_new_item_code", | ||
}; | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters