[fix] validate_valuation_rate for Repack

This commit is contained in:
Anand Doshi
2015-09-21 17:03:47 +05:30
committed by Rushabh Mehta
parent 72fbf902d7
commit 52dfc32eca
2 changed files with 60 additions and 56 deletions

View File

@@ -147,7 +147,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) {
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) { cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) {
return{ return{
query: "erpnext.controllers.queries.item_query", query: "erpnext.controllers.queries.item_query",
filters: [["Item", "name", "!=", doc.item]] filters: [["Item", "name", "!=", cur_frm.doc.item]]
} }
} }

View File

@@ -578,10 +578,14 @@ class StockEntry(StockController):
to_warehouse = self.pro_doc.fg_warehouse to_warehouse = self.pro_doc.fg_warehouse
else: else:
item_code = frappe.db.get_value("BOM", self.bom_no, "item") item_code = frappe.db.get_value("BOM", self.bom_no, "item")
to_warehouse = "" to_warehouse = self.to_warehouse
item = frappe.db.get_value("Item", item_code, ["item_name", item = frappe.db.get_value("Item", item_code, ["item_name",
"description", "stock_uom", "expense_account", "buying_cost_center", "name"], as_dict=1) "description", "stock_uom", "expense_account", "buying_cost_center", "name", "default_warehouse"], as_dict=1)
if not self.production_order and not to_warehouse:
# in case of BOM
to_warehouse = item.default_warehouse
self.add_to_stock_entry_detail({ self.add_to_stock_entry_detail({
item.name: { item.name: {