stock entries from production_order dont fetch serial number of project

stock entries from production_order dont fetch serial number of project
This commit is contained in:
RobertSchouten 2016-09-09 11:02:33 +08:00 committed by GitHub
parent e5d13f3156
commit b7fc4b76e4

View File

@ -478,10 +478,12 @@ def make_stock_entry(production_order_id, purpose, qty=None):
if production_order.source_warehouse:
stock_entry.from_warehouse = production_order.source_warehouse
stock_entry.to_warehouse = production_order.wip_warehouse
stock_entry.project = production_order.project
else:
stock_entry.from_warehouse = production_order.wip_warehouse
stock_entry.to_warehouse = production_order.fg_warehouse
additional_costs = get_additional_costs(production_order, fg_qty=stock_entry.fg_completed_qty)
stock_entry.project = frappe.db.get_value("Stock Entry",{"production_order": production_order_id,"purpose": "Material Transfer for Manufacture"}, "project")
stock_entry.set("additional_costs", additional_costs)
stock_entry.get_items()