chore: Sider and Semgrep

This commit is contained in:
marination 2021-04-21 12:31:15 +05:30
parent 1d94914102
commit 71f4b98d0c
5 changed files with 16 additions and 11 deletions

View File

@ -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

View File

@ -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");
},

View File

@ -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 @@ 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"

View File

@ -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");
}
@ -402,10 +400,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")
});
}
},

View File

@ -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>