Skip to content

Commit

Permalink
Merge pull request #38970 from GursheenK/item-variant-local-attributes
Browse files Browse the repository at this point in the history
fix: use local attribute range in multiple item variant dialog
  • Loading branch information
rohitwaghchaure authored Jan 12, 2024
2 parents d068778 + 43fed29 commit d3aff00
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 @@ -600,26 +600,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 d3aff00

Please sign in to comment.