fix: item stock levels displaying inconsistently (#25506)
* fix: fixed stock levels dashboard not displaying after any interactions * fix: minor translation fix
This commit is contained in:
parent
3b1ae4eb90
commit
dc086dd52f
@ -46,9 +46,6 @@ frappe.ui.form.on("Item", {
|
||||
}, __("View"));
|
||||
}
|
||||
|
||||
if (!frm.doc.is_fixed_asset) {
|
||||
erpnext.item.make_dashboard(frm);
|
||||
}
|
||||
|
||||
if (frm.doc.is_fixed_asset) {
|
||||
frm.trigger('is_fixed_asset');
|
||||
@ -96,6 +93,10 @@ frappe.ui.form.on("Item", {
|
||||
|
||||
erpnext.item.edit_prices_button(frm);
|
||||
erpnext.item.toggle_attributes(frm);
|
||||
|
||||
if (!frm.doc.is_fixed_asset) {
|
||||
erpnext.item.make_dashboard(frm);
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Duplicate'), function() {
|
||||
var new_item = frappe.model.copy_doc(frm.doc);
|
||||
@ -473,11 +474,15 @@ $.extend(erpnext.item, {
|
||||
me.multiple_variant_dialog.get_primary_btn().html(__('Create Variants'));
|
||||
me.multiple_variant_dialog.disable_primary_action();
|
||||
} else {
|
||||
|
||||
let no_of_combinations = lengths.reduce((a, b) => a * b, 1);
|
||||
me.multiple_variant_dialog.get_primary_btn()
|
||||
.html(__(
|
||||
`Make ${no_of_combinations} Variant${no_of_combinations === 1 ? '' : 's'}`
|
||||
));
|
||||
let msg;
|
||||
if (no_of_combinations === 1) {
|
||||
msg = __("Make {0} Variant", [no_of_combinations]);
|
||||
} else {
|
||||
msg = __("Make {0} Variants", [no_of_combinations]);
|
||||
}
|
||||
me.multiple_variant_dialog.get_primary_btn().html(msg);
|
||||
me.multiple_variant_dialog.enable_primary_action();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user