chore: translation / semgrep / sider fixes
This commit is contained in:
parent
c15fef571f
commit
3aed662f46
@ -365,8 +365,8 @@ class Item(WebsiteGenerator):
|
|||||||
# load attributes
|
# load attributes
|
||||||
for v in context.variants:
|
for v in context.variants:
|
||||||
v.attributes = frappe.get_all("Item Variant Attribute",
|
v.attributes = frappe.get_all("Item Variant Attribute",
|
||||||
fields=["attribute", "attribute_value"],
|
fields=["attribute", "attribute_value"],
|
||||||
filters={"parent": v.name})
|
filters={"parent": v.name})
|
||||||
# make a map for easier access in templates
|
# make a map for easier access in templates
|
||||||
v.attribute_map = frappe._dict({})
|
v.attribute_map = frappe._dict({})
|
||||||
for attr in v.attributes:
|
for attr in v.attributes:
|
||||||
@ -1256,7 +1256,7 @@ def get_uom_conv_factor(uom, stock_uom):
|
|||||||
|
|
||||||
inverse_match = frappe.db.get_value("UOM Conversion Factor", {"to_uom": from_uom, "from_uom": to_uom}, ["value"], as_dict=1)
|
inverse_match = frappe.db.get_value("UOM Conversion Factor", {"to_uom": from_uom, "from_uom": to_uom}, ["value"], as_dict=1)
|
||||||
if inverse_match:
|
if inverse_match:
|
||||||
return 1 / inverse_match.value
|
return 1 / inverse_match.value
|
||||||
|
|
||||||
# This attempts to try and get conversion from intermediate UOM.
|
# This attempts to try and get conversion from intermediate UOM.
|
||||||
# case:
|
# case:
|
||||||
|
@ -518,11 +518,11 @@ class TestItem(unittest.TestCase):
|
|||||||
|
|
||||||
def test_attribute_completions(self):
|
def test_attribute_completions(self):
|
||||||
expected_attrs = [{'attribute_value': 'Small'},
|
expected_attrs = [{'attribute_value': 'Small'},
|
||||||
{'attribute_value': 'Extra Small'},
|
{'attribute_value': 'Extra Small'},
|
||||||
{'attribute_value': 'Extra Large'},
|
{'attribute_value': 'Extra Large'},
|
||||||
{'attribute_value': 'Large'},
|
{'attribute_value': 'Large'},
|
||||||
{'attribute_value': '2XL'},
|
{'attribute_value': '2XL'},
|
||||||
{'attribute_value': 'Medium'}]
|
{'attribute_value': 'Medium'}]
|
||||||
|
|
||||||
attrs = get_item_attribute("Test Size")
|
attrs = get_item_attribute("Test Size")
|
||||||
self.assertEqual(attrs, expected_attrs)
|
self.assertEqual(attrs, expected_attrs)
|
||||||
|
@ -96,7 +96,7 @@ class StockReconciliation(StockController):
|
|||||||
|
|
||||||
def validate_data(self):
|
def validate_data(self):
|
||||||
def _get_msg(row_num, msg):
|
def _get_msg(row_num, msg):
|
||||||
return _("Row # {0}: ").format(row_num+1) + msg
|
return _("Row # {0}:").format(row_num+1) + " " + msg
|
||||||
|
|
||||||
self.validation_messages = []
|
self.validation_messages = []
|
||||||
item_warehouse_combinations = []
|
item_warehouse_combinations = []
|
||||||
@ -182,7 +182,7 @@ class StockReconciliation(StockController):
|
|||||||
validate_cancelled_item(item_code, item.docstatus)
|
validate_cancelled_item(item_code, item.docstatus)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.validation_messages.append(_("Row # ") + ("%d: " % (row.idx)) + cstr(e))
|
self.validation_messages.append(_("Row #") + " " + ("%d: " % (row.idx)) + cstr(e))
|
||||||
|
|
||||||
def update_stock_ledger(self):
|
def update_stock_ledger(self):
|
||||||
""" find difference between current and expected entries
|
""" find difference between current and expected entries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user