feat: Provision to set Default Item Manufacturer

- Is Default checkbox added in Item Manufacturer
- Default Item Manufacturer and Part No fields added to Item Master
- Manufacturer Part No field editable in all child tables with validation
- Manufacturer and Part No auto fetched via get_item_details in child table
This commit is contained in:
marination
2020-04-07 21:00:57 +05:30
parent 38896efd6d
commit 849ec84852
10 changed files with 105 additions and 19 deletions

View File

@@ -379,7 +379,31 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
}
});
}
}
},
manufacturer_part_no: function(doc, cdt, cdn) {
const row = locals[cdt][cdn];
if (row.manufacturer_part_no) {
frappe.model.get_value('Item Manufacturer',
{
'item_code': row.item_code,
'manufacturer': row.manufacturer,
'manufacturer_part_no': row.manufacturer_part_no
},
'name',
function(data) {
if (!data) {
let msg = {
message: __("Manufacturer Part Number <b>{0}</b> is invalid", [row.manufacturer_part_no]),
title: __("Invalid Part Number")
}
frappe.throw(msg);
}
});
}
}
});
cur_frm.add_fetch('project', 'cost_center', 'cost_center');