[Fix] Meta object has no attribute permissions (#15316)
This commit is contained in:
parent
73bd3cb278
commit
bcaca85873
@ -631,15 +631,10 @@ $.extend(erpnext.item, {
|
||||
.on('input', function(e) {
|
||||
var term = e.target.value;
|
||||
frappe.call({
|
||||
method:"frappe.client.get_list",
|
||||
method:"erpnext.stock.doctype.item.item.get_item_attribute",
|
||||
args:{
|
||||
doctype:"Item Attribute Value",
|
||||
filters: [
|
||||
["parent","=", i],
|
||||
["attribute_value", "like", term + "%"]
|
||||
],
|
||||
fields: ["attribute_value"],
|
||||
parent: "Item"
|
||||
parent: i,
|
||||
attribute_value: term
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
|
@ -977,4 +977,12 @@ def get_uom_conv_factor(uom, stock_uom):
|
||||
if uom_stock.from_uom == uom_row.from_uom:
|
||||
value = flt(uom_stock.value) * 1/flt(uom_row.value)
|
||||
|
||||
return value
|
||||
return value
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_item_attribute(parent, attribute_value=''):
|
||||
if not frappe.has_permission("Item"):
|
||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
||||
|
||||
return frappe.get_all("Item Attribute Value", fields = ["attribute_value"],
|
||||
filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)})
|
||||
|
Loading…
x
Reference in New Issue
Block a user