How to update all item masters without Import

Hi,

I have recently added a server side script on item master to calculate the net weight of the item. Now I would like to know if there is a way with which I could calculate the net weight of all the items at back end and enter the values in their respective item masters without being able to import all items.

Hint:

for item in frappe.get_all("Item"):
    item_doc = frappe.get_doc("Item", item.name)
    item_doc.caculate_net_weight()
    item_doc.save()

Run the script from ipython.

2 Likes