Skip to content

Commit

Permalink
fix: item rate not fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Jan 28, 2023
1 parent 6b31c27 commit 0d7f98b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
var me = this;
var valid = true;

if (frappe.flags.ignore_company_party_validation) {
return valid;
}

$.each(["company", "customer"], function(i, fieldname) {
if(frappe.meta.has_field(me.frm.doc.doctype, fieldname) && !["Purchase Order","Purchase Invoice"].includes(me.frm.doc.doctype)) {
if (!me.frm.doc[fieldname]) {
Expand Down
8 changes: 7 additions & 1 deletion erpnext/stock/doctype/item/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,12 @@ function open_form(frm, doctype, child_doctype, parentfield) {
new_child_doc.uom = frm.doc.stock_uom;
new_child_doc.description = frm.doc.description;

frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
frappe.run_serially([
() => frappe.ui.form.make_quick_entry(doctype, null, null, new_doc),
() => {
frappe.flags.ignore_company_party_validation = true;
frappe.model.trigger("item_code", frm.doc.name, new_child_doc);
}
])
});
}

0 comments on commit 0d7f98b

Please sign in to comment.