-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
355 additions
and
229 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,2 +1,2 @@ | ||
from __future__ import unicode_literals | ||
__version__ = '5.0.9' | ||
__version__ = '5.0.10' |
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
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
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
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
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
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
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
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
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||
// License: GNU General Public License v3. See license.txt | ||
|
||
frappe.pages['bom-browser'].on_page_load = function(wrapper) { | ||
var page = frappe.ui.make_app_page({ | ||
parent: wrapper, | ||
title: 'BOM Browser', | ||
single_column: true | ||
}); | ||
|
||
page.main.css({ | ||
"min-height": "300px", | ||
"padding-bottom": "25px" | ||
}); | ||
|
||
page.tree_area = $('<div class="padding"><p class="text-muted">'+ | ||
__("Select BOM to start") | ||
+'</p></div>').appendTo(page.main); | ||
|
||
frappe.breadcrumbs.add(frappe.breadcrumbs.last_module || "Manufacturing"); | ||
|
||
var make_tree = function() { | ||
erpnext.bom_tree = new erpnext.BOMTree(page.$bom_select.val(), page, page.tree_area); | ||
} | ||
|
||
page.$bom_select = wrapper.page.add_field({fieldname: "bom", | ||
fieldtype:"Link", options: "BOM", label: __("BOM")}).$input | ||
.change(function() { | ||
make_tree(); | ||
}); | ||
|
||
page.set_secondary_action(__('Refresh'), function() { | ||
make_tree(); | ||
}); | ||
} | ||
|
||
|
||
frappe.pages['bom-browser'].on_page_show = function(wrapper){ | ||
// set from route | ||
var bom = null; | ||
if(frappe.get_route()[1]) { | ||
var bom = frappe.get_route().splice(1).join("/"); | ||
} | ||
if(frappe.route_options && frappe.route_options.bom) { | ||
var bom = frappe.route_options.bom; | ||
} | ||
if(bom) { | ||
wrapper.page.$bom_select.val(bom).trigger("change"); | ||
} | ||
}; | ||
|
||
erpnext.BOMTree = Class.extend({ | ||
init: function(root, page, parent) { | ||
$(parent).empty(); | ||
var me = this; | ||
me.page = page; | ||
me.bom = page.$bom_select.val(); | ||
me.can_read = frappe.model.can_read("BOM"); | ||
me.can_create = frappe.boot.user.can_create.indexOf("BOM") !== -1 || | ||
frappe.boot.user.in_create.indexOf("BOM") !== -1; | ||
me.can_write = frappe.model.can_write("BOM"); | ||
me.can_delete = frappe.model.can_delete("BOM"); | ||
|
||
this.tree = new frappe.ui.Tree({ | ||
parent: $(parent), | ||
label: me.bom, | ||
args: {parent: me.bom}, | ||
method: 'erpnext.manufacturing.page.bom_browser.bom_browser.get_children', | ||
toolbar: [ | ||
{toggle_btn: true}, | ||
{ | ||
label:__("Edit"), | ||
condition: function(node) { | ||
return node.expandable; | ||
}, | ||
click: function(node) { | ||
frappe.set_route("Form", "BOM", node.data.parent); | ||
} | ||
} | ||
], | ||
get_label: function(node) { | ||
if(node.data.qty) { | ||
return node.data.qty + " x " + node.data.value; | ||
} else { | ||
return node.data.value; | ||
} | ||
} | ||
}); | ||
} | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"content": null, | ||
"creation": "2015-05-25 02:57:33.472044", | ||
"docstatus": 0, | ||
"doctype": "Page", | ||
"modified": "2015-05-25 02:57:33.472044", | ||
"modified_by": "Administrator", | ||
"module": "Manufacturing", | ||
"name": "bom-browser", | ||
"owner": "Administrator", | ||
"page_name": "bom-browser", | ||
"roles": [ | ||
{ | ||
"role": "Manufacturing User" | ||
} | ||
], | ||
"script": null, | ||
"standard": "Yes", | ||
"style": null, | ||
"title": "BOM Browser" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||
# License: GNU General Public License v3. See license.txt | ||
|
||
from __future__ import unicode_literals | ||
import frappe | ||
|
||
@frappe.whitelist() | ||
def get_children(parent): | ||
return frappe.db.sql("""select item_code as value, | ||
bom_no as parent, qty, | ||
if(ifnull(bom_no, "")!="", 1, 0) as expandable | ||
from `tabBOM Item` | ||
where parent=%s | ||
order by idx | ||
""", parent, as_dict=True) |
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import frappe | ||
|
||
def execute(): | ||
frappe.reload_doctype("System Settings") | ||
ss = frappe.get_doc("System Settings", "System Settings") | ||
ss.email_footer_address = frappe.db.get_default("company") | ||
ss.save() |
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
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.