This commit is contained in:
Rushabh Mehta
2014-03-28 16:44:37 +05:30
parent 43405203b2
commit b385ecf65e
83 changed files with 349 additions and 349 deletions

View File

@@ -134,11 +134,11 @@ class Bom(Document):
})["rate"]
if self.docstatus == 0:
frappe.bean(self.doclist).save()
frappe.get_doc(self.doclist).save()
elif self.docstatus == 1:
self.calculate_cost()
self.update_exploded_items()
frappe.bean(self.doclist).update_after_submit()
frappe.get_doc(self.doclist).update_after_submit()
def get_bom_unitcost(self, bom_no):
bom = frappe.db.sql("""select name, total_cost/quantity as unit_cost from `tabBOM`

View File

@@ -152,7 +152,7 @@ def get_item_details(item):
@frappe.whitelist()
def make_stock_entry(production_order_id, purpose):
production_order = frappe.bean("Production Order", production_order_id)
production_order = frappe.get_doc("Production Order", production_order_id)
stock_entry = frappe.new_bean("Stock Entry")
stock_entry.purpose = purpose

View File

@@ -17,22 +17,22 @@ class TestProductionOrder(unittest.TestCase):
frappe.db.sql("""delete from `tabBin`""")
frappe.db.sql("""delete from `tabGL Entry`""")
pro_bean = frappe.bean(copy = test_records[0])
pro_bean = frappe.get_doc(copy = test_records[0])
pro_bean.insert()
pro_bean.submit()
from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records
mr1 = frappe.bean(copy = se_test_records[0])
mr1 = frappe.get_doc(copy = se_test_records[0])
mr1.insert()
mr1.submit()
mr2 = frappe.bean(copy = se_test_records[0])
mr2 = frappe.get_doc(copy = se_test_records[0])
mr2.doclist[1].item_code = "_Test Item Home Desktop 100"
mr2.insert()
mr2.submit()
stock_entry = make_stock_entry(pro_bean.name, "Manufacture/Repack")
stock_entry = frappe.bean(stock_entry)
stock_entry = frappe.get_doc(stock_entry)
stock_entry.fiscal_year = "_Test Fiscal Year 2013"
stock_entry.fg_completed_qty = 4
stock_entry.posting_date = "2013-05-12"
@@ -52,7 +52,7 @@ class TestProductionOrder(unittest.TestCase):
pro_order = self.test_planned_qty()
stock_entry = make_stock_entry(pro_order, "Manufacture/Repack")
stock_entry = frappe.bean(stock_entry)
stock_entry = frappe.get_doc(stock_entry)
stock_entry.posting_date = "2013-05-12"
stock_entry.fiscal_year = "_Test Fiscal Year 2013"
stock_entry.fg_completed_qty = 15

View File

@@ -365,7 +365,7 @@ class ProductionPlanningTool(Document):
purchase_request_list = []
if items_to_be_requested:
for item in items_to_be_requested:
item_wrapper = frappe.bean("Item", item)
item_wrapper = frappe.get_doc("Item", item)
pr_doc = frappe.get_doc({
"doctype": "Material Request",
"__islocal": 1,