Skip to content

Commit

Permalink
fix: use child table values instead of global min max
Browse files Browse the repository at this point in the history
(cherry picked from commit 43fed29)
  • Loading branch information
GursheenK authored and mergify[bot] committed Jan 12, 2024
1 parent 7ae1df6 commit d21fc60
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions erpnext/stock/doctype/item/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,26 +630,12 @@ $.extend(erpnext.item, {
}
});
} else {
frappe.call({
method: "frappe.client.get",
args: {
doctype: "Item Attribute",
name: d.attribute
}
}).then((r) => {
if(r.message) {
const from = r.message.from_range;
const to = r.message.to_range;
const increment = r.message.increment;

let values = [];
for(var i = from; i <= to; i = flt(i + increment, 6)) {
values.push(i);
}
attr_val_fields[d.attribute] = values;
resolve();
}
});
let values = [];
for(var i = d.from_range; i <= d.to_range; i = flt(i + d.increment, 6)) {
values.push(i);
}
attr_val_fields[d.attribute] = values;
resolve();
}
});

Expand Down

0 comments on commit d21fc60

Please sign in to comment.