'It will raise production order (Draft) for all distinct FG items'

def raise_production_orders(self):

    self.validate_data()
    from erpnext.utilities.transaction_base import validate_uom_is_integer
    validate_uom_is_integer(self, u'stock_uom', u'planned_qty')
    items = self.get_production_items()
    pro_list = []
    frappe.flags.mute_messages = True
    for key in items:
        production_order = self.create_production_order(items[key])
        if production_order:
            pro_list.append(production_order)
    frappe.flags.mute_messages = False
    if pro_list:
        pro_list = [(u'<a    href="#Form/Production    Order/%s"    target="_blank">%s</a>' % (p, p)) for p in pro_list]
        msgprint(_(u'{0}    created').format(comma_and(pro_list)))
    else:
        msgprint(_(u'No    Production    Orders    created'))
