mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-18 02:55:20 +00:00
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user