mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 21:52:21 +01:00
chore: Sider and Semgrep
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
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 @@ class ProductFiltersBuilder:
|
||||
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"
|
||||
|
||||
@@ -17,8 +17,6 @@ frappe.ui.form.on("Item", {
|
||||
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");
|
||||
}
|
||||
@@ -405,10 +403,12 @@ $.extend(erpnext.item, {
|
||||
}, __("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")
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -482,7 +482,7 @@ $.extend(erpnext.item, {
|
||||
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'}`
|
||||
'Make {0} Variant{1}', [no_of_combinations, no_of_combinations === 1 ? '' : 's']
|
||||
));
|
||||
me.multiple_variant_dialog.enable_primary_action();
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user