chore: Sider and Semgrep
diff --git a/erpnext/e_commerce/doctype/item_review/item_review.py b/erpnext/e_commerce/doctype/item_review/item_review.py
index f19dcf3..772da04 100644
--- a/erpnext/e_commerce/doctype/item_review/item_review.py
+++ b/erpnext/e_commerce/doctype/item_review/item_review.py
@@ -5,6 +5,7 @@
from __future__ import unicode_literals
from datetime import datetime
import frappe
+from frappe import _
from frappe.model.document import Document
from frappe.contacts.doctype.contact.contact import get_contact_name
from frappe.utils import flt, cint
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.js b/erpnext/e_commerce/doctype/website_item/website_item.js
index 0d8a51e..741e78f 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.js
+++ b/erpnext/e_commerce/doctype/website_item/website_item.js
@@ -2,6 +2,11 @@
// For license information, please see license.txt
frappe.ui.form.on('Website Item', {
+ onload: function(frm) {
+ // should never check Private
+ frm.fields_dict["website_image"].df.is_private = 0;
+ },
+
image: function() {
refresh_field("image_view");
},
diff --git a/erpnext/e_commerce/filters.py b/erpnext/e_commerce/filters.py
index 9ad817c..0d96a11 100644
--- a/erpnext/e_commerce/filters.py
+++ b/erpnext/e_commerce/filters.py
@@ -3,7 +3,7 @@
import frappe
from frappe import _dict
-from frappe.utils import floor, ceil, flt
+from frappe.utils import floor
class ProductFiltersBuilder:
def __init__(self, item_group=None):
@@ -97,8 +97,8 @@
min_discount, max_discount = discounts[0], discounts[1]
# [25, 60]
min_range_absolute, max_range_absolute = floor(min_discount), floor(max_discount)
- min_range = int(min_discount - (min_range_absolute%10)) # 20
- max_range = int(max_discount - (max_range_absolute%10)) # 60
+ min_range = int(min_discount - (min_range_absolute % 10)) # 20
+ max_range = int(max_discount - (max_range_absolute % 10)) # 60
for discount in range(min_range, (max_range + 1), 10):
label = f"{discount}% and above"
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index b3edd9f..f361c88 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -17,8 +17,6 @@
frm.fields_dict["attributes"].grid.set_column_disp("attribute_value", true);
}
- // should never check Private
- frm.fields_dict["website_image"].df.is_private = 0;
if (frm.doc.is_fixed_asset) {
frm.trigger("set_asset_naming_series");
}
@@ -402,10 +400,12 @@
}, __("Actions"));
},
- weight_to_validate: function(frm){
- if((frm.doc.nett_weight || frm.doc.gross_weight) && !frm.doc.weight_uom) {
- frappe.msgprint(__('Weight is mentioned,\nPlease mention "Weight UOM" too'));
- frappe.validated = 0;
+ weight_to_validate: function(frm) {
+ if (frm.doc.weight_per_unit && !frm.doc.weight_uom) {
+ frappe.msgprint({
+ message: __("Please mention 'Weight UOM' along with Weight."),
+ title: __("Note")
+ });
}
},
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html
index 2c5f7b9..d371352 100644
--- a/erpnext/templates/includes/macros.html
+++ b/erpnext/templates/includes/macros.html
@@ -337,8 +337,7 @@
class="product-filter field-filter"
id="{{value}}"
data-filter-name="{{ item_field.fieldname }}"
- data-filter-value="{{ value }}"
- >
+ data-filter-value="{{ value }}">
<span class="label-area">{{ value }}</span>
</label>
</div>