'update requested qty (before ordered_qty is updated)'

def update_requested_qty(self, mr_item_rows=None):

    item_wh_list = []
    for d in self.get(u'items'):
        if (((not mr_item_rows) or (d.name in mr_item_rows)) and ([d.item_code, d.warehouse] not in item_wh_list) and (frappe.db.get_value(u'Item', d.item_code, u'is_stock_item') == 1) and d.warehouse):
            item_wh_list.append([d.item_code, d.warehouse])
    for (item_code, warehouse) in item_wh_list:
        update_bin_qty(item_code, warehouse, {u'indented_qty': get_indented_qty(item_code, warehouse)})
