'Generates moves and work orders
@return: Newly generated picking Id.'

@api.multi
def _generate_moves(self):

    res = super(MrpProduction, self)._generate_moves()
    for production in self.filtered((lambda production: production.bom_id)):
        for sub_product in production.bom_id.sub_products:
            production._create_byproduct_move(sub_product)
    return res
