mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
[Fix] Meta object has no attribute permissions (#15316)
This commit is contained in:
committed by
Nabin Hait
parent
73bd3cb278
commit
bcaca85873
@@ -631,15 +631,10 @@ $.extend(erpnext.item, {
|
|||||||
.on('input', function(e) {
|
.on('input', function(e) {
|
||||||
var term = e.target.value;
|
var term = e.target.value;
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method:"frappe.client.get_list",
|
method:"erpnext.stock.doctype.item.item.get_item_attribute",
|
||||||
args:{
|
args:{
|
||||||
doctype:"Item Attribute Value",
|
parent: i,
|
||||||
filters: [
|
attribute_value: term
|
||||||
["parent","=", i],
|
|
||||||
["attribute_value", "like", term + "%"]
|
|
||||||
],
|
|
||||||
fields: ["attribute_value"],
|
|
||||||
parent: "Item"
|
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (r.message) {
|
if (r.message) {
|
||||||
|
|||||||
@@ -977,4 +977,12 @@ def get_uom_conv_factor(uom, stock_uom):
|
|||||||
if uom_stock.from_uom == uom_row.from_uom:
|
if uom_stock.from_uom == uom_row.from_uom:
|
||||||
value = flt(uom_stock.value) * 1/flt(uom_row.value)
|
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)})
|
||||||
|
|||||||
Reference in New Issue
Block a user