Merge pull request #30494 from resilient-tech/fix-get-cached-value
fix: update `get_cached_value` usage based on changes in definition
This commit is contained in:
commit
b9d37152ba
@ -375,12 +375,12 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
|
|||||||
|
|
||||||
def update_args_for_pricing_rule(args):
|
def update_args_for_pricing_rule(args):
|
||||||
if not (args.item_group and args.brand):
|
if not (args.item_group and args.brand):
|
||||||
try:
|
item = frappe.get_cached_value("Item", args.item_code, ("item_group", "brand"))
|
||||||
args.item_group, args.brand = frappe.get_cached_value(
|
if not item:
|
||||||
"Item", args.item_code, ["item_group", "brand"]
|
|
||||||
)
|
|
||||||
except frappe.DoesNotExistError:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
args.item_group, args.brand = item
|
||||||
|
|
||||||
if not args.item_group:
|
if not args.item_group:
|
||||||
frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code))
|
frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user