Skip to content

Commit

Permalink
fix: set item uom as stock_uom if it isn't set (backport frappe#27623) (
Browse files Browse the repository at this point in the history
frappe#27781)

* fix: set item uom as stock_uom if it isn't set (frappe#27623)

* fix: set item uom as stock_uom if it isn't set

(cherry picked from commit 5c37220)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.js

* fix: resolve conflicts

[skip ci]

Co-authored-by: Alan <2.alan.tom@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
  • Loading branch information
3 people authored Oct 4, 2021
1 parent 93a744d commit d1480be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ frappe.ui.form.on('Stock Entry', {
frm.trigger("setup_quality_inspection");
},

before_save: function(frm) {
frm.doc.items.forEach((item) => {
item.uom = item.uom || item.stock_uom;
})
},

purpose: function(frm) {
frm.trigger('validate_purpose_consumption');
frm.fields_dict.items.grid.refresh();
Expand Down

0 comments on commit d1480be

Please sign in to comment.