Skip to content

Commit

Permalink
fix: logic for displaying Manufacturing, Purchase Details shifted to … (
Browse files Browse the repository at this point in the history
#516)

Co-authored-by: Rohan <Alchez@users.noreply.github.com>
  • Loading branch information
bhattdevarsh and Alchez authored Aug 27, 2020
1 parent 75e11f6 commit a9508f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
12 changes: 0 additions & 12 deletions erpnext/stock/doctype/quality_inspection/quality_inspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ cur_frm.cscript.refresh = cur_frm.cscript.inspection_type;
frappe.ui.form.on("Quality Inspection", {
item_code: function (frm) {
if (frm.doc.item_code) {
if (["Purchase Invoice", "Purchase Receipt"].includes(frm.doc.reference_type)) {
if (frm.doc.reference_name) {
frm.call({
method: "get_purchase_item_details",
doc: frm.doc,
callback: function (data) {
refresh_field(["manufacturer_name", "manufacturer_website", "uom", "qty"]);
}
})
}
}

frm.trigger("check_compliance_item");
frappe.db.get_value('Item', { name: frm.doc.item_code }, ['has_batch_no', 'has_serial_no'], (r) => {
frm.toggle_reqd("batch_no", r.has_batch_no);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def validate(self):
if not self.readings and self.item_code:
self.get_item_specification_details()

if self.reference_type in ["Purchase Invoice", "Purchase Receipt"] and self.reference_name:
self.get_purchase_item_details()

def get_item_specification_details(self):
if not self.quality_inspection_template:
self.quality_inspection_template = frappe.db.get_value('Item',
Expand Down

0 comments on commit a9508f7

Please sign in to comment.