mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
bom cleanup: update cost and flat bom by traversing full tree
This commit is contained in:
@@ -103,4 +103,24 @@ erpnext.queries.account = function(opts) {
|
||||
AND tabAccount.%(key)s LIKE "%s" ' + (conditions
|
||||
? (" AND " + conditions.join(" AND "))
|
||||
: "")
|
||||
}
|
||||
|
||||
erpnext.queries.bom = function(opts) {
|
||||
conditions = [];
|
||||
if (opts) {
|
||||
$.each(opts, function(key, val) {
|
||||
if (esc_quotes(val).charAt(0) != "!")
|
||||
conditions.push("tabBOM.`" + key + "`='"+esc_quotes(val)+"'");
|
||||
else
|
||||
conditions.push("tabBOM.`" + key + "`!='"+esc_quotes(val).substr(1)+"'");
|
||||
});
|
||||
}
|
||||
|
||||
return 'SELECT tabBOM.name, tabBOM.item \
|
||||
FROM tabBOM \
|
||||
WHERE tabBOM.docstatus=1 \
|
||||
AND tabBOM.is_active="Yes" \
|
||||
AND tabBOM.%(key)s LIKE "%s" ' + (conditions.length
|
||||
? (" AND " + conditions.join(" AND "))
|
||||
: "")
|
||||
}
|
||||
Reference in New Issue
Block a user