Hello everyone
In reference to my last thread, I’m faced with a new type of error I have yet to resolve.
So, assuming I have an Article with Number 101 under the Item Group “Clocks”. I’d like to give it the subgroup “Alarm”. This particular subgroup is already part of the Item Group Tree and is a part of “Clocks”.
This is currently in the system. Now on to add “Alarm” to the subgroup I would do this:
doc = frappe.get_doc(
{
"doctype":"Item",
"item_code":"101"
"item_subgroups": frappe.get_doc({"doctype":"Item Group", "item_group_name": "Alarm")})
})
print(doc.item_subgroups.item_group_name) \\\ Returns "Alarm"
doc.save()
This however, throws this error:
frappe.exceptions.MandatoryError: [Item, 101]: item_group
So I was wondering what did I do wrong? I cannot directly enter a String, because “item_subgroups” expects an object (namely, an object from “item_group”) I feel it’s something simple that I’ve overlooked.
Kind regards,
Val