[fix] if bom specified on purchase order item then don't pull default bom in purchase receipt (#10793)

* [fix] if bom specified on purchase order item then don't pull default bom in purchase receipt

* Update bom.js

* Update stock_entry.py
This commit is contained in:
Saurabh 2017-09-18 15:49:19 +05:30 committed by Nabin Hait
parent d7e1869a70
commit 590d401e5f
4 changed files with 5 additions and 3 deletions

View File

@ -295,6 +295,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"field_map": {
"name": "purchase_order_item",
"parent": "purchase_order",
"bom": "bom"
},
"postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty) and doc.delivered_by_supplier!=1

View File

@ -19,7 +19,7 @@ frappe.ui.form.on("BOM", {
frm.set_query("source_warehouse", "items", function() {
return {
filters: {
'company': frm.doc.company,
'company': frm.doc.company
}
};
});

View File

@ -631,7 +631,8 @@ class StockEntry(StockController):
fetch_exploded = self.use_multi_level_bom)
for item in item_dict.values():
item.from_warehouse = self.from_warehouse or item.default_warehouse
# if source warehouse presents in BOM set from_warehouse as bom source_warehouse
item.from_warehouse = self.from_warehouse or item.source_warehouse or item.default_warehouse
return item_dict
def get_bom_scrap_material(self, qty):

View File

@ -90,7 +90,7 @@ def get_item_details(args):
item.lead_time_days)
if args.get("is_subcontracted") == "Yes":
out.bom = get_default_bom(args.item_code)
out.bom = args.get('bom') or get_default_bom(args.item_code)
get_gross_profit(out)