Form calculation with inventory widget is not working correctly