Skip to content

Commit

Permalink
Merge pull request frappe#33847 from frappe/mergify/bp/version-13-hot…
Browse files Browse the repository at this point in the history
…fix/pr-33845

fix: item rate not fetching (backport frappe#33845)
  • Loading branch information
rohitwaghchaure authored Jan 28, 2023
2 parents fc7aac9 + bb56415 commit 0902a5c
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 @@ -1781,6 +1781,10 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
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) && me.frm.doc.doctype != "Purchase Order") {
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 @@ -849,6 +849,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 0902a5c

Please sign in to comment.